Skip to content

Commit

Permalink
Revert "Ci debug (#293)" (#294)
Browse files Browse the repository at this point in the history
This reverts commit c6f8a82.
  • Loading branch information
luoyuxia authored Dec 31, 2024
1 parent c6f8a82 commit 61b53ec
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 115 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ on:
- main
- release-**
- ci-**
schedule:
- cron: '0 * * * *'
pull_request:
paths-ignore:
- 'website/**'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,6 @@ public UpsertWriter getUpsertWriter(UpsertWrite upsertWrite) {
metadataUpdater);
}

public MetadataUpdater getMetadataUpdater() {
return metadataUpdater;
}

@Override
public UpsertWriter getUpsertWriter() {
return getUpsertWriter(new UpsertWrite());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.alibaba.fluss.client.scanner.log.ScanRecords;
import com.alibaba.fluss.client.table.writer.AppendWriter;
import com.alibaba.fluss.client.table.writer.UpsertWriter;
import com.alibaba.fluss.cluster.Cluster;
import com.alibaba.fluss.config.AutoPartitionTimeUnit;
import com.alibaba.fluss.config.ConfigOptions;
import com.alibaba.fluss.exception.PartitionNotExistException;
Expand All @@ -36,8 +35,6 @@
import com.alibaba.fluss.types.DataTypes;

import org.junit.jupiter.api.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.time.Duration;
import java.util.ArrayList;
Expand All @@ -56,8 +53,6 @@
/** IT case for Fluss partitioned table. */
class FlussPartitionedTableITCase extends ClientToServerITCaseBase {

private static final Logger LOG = LoggerFactory.getLogger(FlussPartitionedTableITCase.class);

@Test
void testPartitionedPrimaryKeyTable() throws Exception {
Schema schema = createPartitionedTable(DATA1_TABLE_PATH_PK, true);
Expand All @@ -80,28 +75,17 @@ void testPartitionedPrimaryKeyTable() throws Exception {
}
upsertWriter.flush();

Cluster cluster = ((FlussTable) table).getMetadataUpdater().getCluster();

try {
// now, let's lookup the written data by look up
for (String partition : partitionIdByNames.keySet()) {
for (int i = 0; i < recordsPerPartition; i++) {
InternalRow actualRow =
compactedRow(schema.toRowType(), new Object[] {i, "a" + i, partition});
InternalRow lookupRow =
table.lookup(keyRow(schema, new Object[] {i, null, partition}))
.get()
.getRow();
assertThat(lookupRow).isEqualTo(actualRow);
}
// now, let's lookup the written data by look up
for (String partition : partitionIdByNames.keySet()) {
for (int i = 0; i < recordsPerPartition; i++) {
InternalRow actualRow =
compactedRow(schema.toRowType(), new Object[] {i, "a" + i, partition});
InternalRow lookupRow =
table.lookup(keyRow(schema, new Object[] {i, null, partition}))
.get()
.getRow();
assertThat(lookupRow).isEqualTo(actualRow);
}
} catch (Exception e) {
LOG.error("testPartitionedPrimaryKeyTable fail.", e);
LOG.error("old cluster: {}.", cluster);
LOG.error(
"cluster: tostring, {}.",
((FlussTable) table).getMetadataUpdater().getCluster());
throw e;
}

// then, let's scan and check the cdc log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import com.alibaba.fluss.client.table.writer.TableWriter;
import com.alibaba.fluss.client.table.writer.UpsertWrite;
import com.alibaba.fluss.client.table.writer.UpsertWriter;
import com.alibaba.fluss.cluster.Cluster;
import com.alibaba.fluss.config.ConfigOptions;
import com.alibaba.fluss.config.Configuration;
import com.alibaba.fluss.config.MemorySize;
Expand All @@ -52,8 +51,6 @@
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.annotation.Nullable;

Expand Down Expand Up @@ -82,8 +79,6 @@
/** IT case for {@link FlussTable}. */
class FlussTableITCase extends ClientToServerITCaseBase {

private static final Logger LOG = LoggerFactory.getLogger(FlussTableITCase.class);

@Test
void testGetDescriptor() throws Exception {
createTable(DATA1_TABLE_PATH_PK, DATA1_TABLE_INFO_PK.getTableDescriptor(), false);
Expand Down Expand Up @@ -343,25 +338,13 @@ void testLimitScanLogTable() throws Exception {
void verifyPutAndLookup(Table table, Schema tableSchema, Object[] fields) throws Exception {
// put data.
InternalRow row = compactedRow(tableSchema.toRowType(), fields);

UpsertWriter upsertWriter = table.getUpsertWriter();
// put data.
upsertWriter.upsert(row);
upsertWriter.flush();

Cluster cluster = ((FlussTable) table).getMetadataUpdater().getCluster();
try {
// lookup this key.
IndexedRow keyRow = keyRow(tableSchema, fields);
assertThat(lookupRow(table, keyRow)).isEqualTo(row);
} catch (Exception e) {
LOG.error("testPutAndLookup fail.", e);
LOG.error("old cluster: {}.", cluster);
LOG.error(
"cluster: tostring, {}.",
((FlussTable) table).getMetadataUpdater().getCluster());
throw e;
}
// lookup this key.
IndexedRow keyRow = keyRow(tableSchema, fields);
assertThat(lookupRow(table, keyRow)).isEqualTo(row);
}

private InternalRow lookupRow(Table table, IndexedRow keyRow) throws Exception {
Expand Down
16 changes: 9 additions & 7 deletions fluss-client/src/test/resources/log4j2-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Set root logger level to OFF to not flood build logs
# set manually to INFO for debugging purposes
rootLogger.level=ERROR
rootLogger.appenderRef.test.ref=TestLogger
appender.testlogger.name=TestLogger
appender.testlogger.type=CONSOLE
appender.testlogger.target=SYSTEM_ERR
appender.testlogger.layout.type=PatternLayout
appender.testlogger.layout.pattern=%-4r [%t] %-5p %c %x - %m%n
rootLogger.level = OFF
rootLogger.appenderRef.test.ref = TestLogger

appender.testlogger.name = TestLogger
appender.testlogger.type = CONSOLE
appender.testlogger.target = SYSTEM_ERR
appender.testlogger.layout.type = PatternLayout
appender.testlogger.layout.pattern = %-4r [%t] %-5p %c %x - %m%n
26 changes: 0 additions & 26 deletions fluss-common/src/main/java/com/alibaba/fluss/cluster/Cluster.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,30 +335,4 @@ public static Cluster empty() {
return location.getLeader();
}
}

@Override
public String toString() {
return "Cluster{"
+ "coordinatorServer="
+ coordinatorServer
+ ", availableLocationsByPath="
+ availableLocationsByPath
+ ", availableLocationByBucket="
+ availableLocationByBucket
+ ", aliveTabletServersById="
+ aliveTabletServersById
+ ", aliveTabletServers="
+ aliveTabletServers
+ ", tableIdByPath="
+ tableIdByPath
+ ", pathByTableId="
+ pathByTableId
+ ", partitionsIdByPath="
+ partitionsIdByPath
+ ", partitionNameById="
+ partitionNameById
+ ", tableInfoByPath="
+ tableInfoByPath
+ '}';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Set root logger level to OFF to not flood build logs
# set manually to INFO for debugging purposes
rootLogger.level=INFO
rootLogger.appenderRef.test.ref=TestLogger
appender.testlogger.name=TestLogger
appender.testlogger.type=CONSOLE
appender.testlogger.target=SYSTEM_ERR
appender.testlogger.layout.type=PatternLayout
appender.testlogger.layout.pattern=%-4r [%t] %-5p %c %x - %m%n
rootLogger.level = OFF
rootLogger.appenderRef.test.ref = TestLogger

appender.testlogger.name = TestLogger
appender.testlogger.type = CONSOLE
appender.testlogger.target = SYSTEM_ERR
appender.testlogger.layout.type = PatternLayout
appender.testlogger.layout.pattern = %-4r [%t] %-5p %c %x - %m%n

Original file line number Diff line number Diff line change
Expand Up @@ -329,16 +329,7 @@ public LogAppendInfo putAsLeader(
// should not append.
if (appendedRecordCount > 0) {
// now, we can build the full log.
LogAppendInfo logAppendInfo =
logTablet.appendAsLeader(walBuilder.build());
long logEndOffset = logAppendInfo.lastOffset();
if (logEndOffset != logOffset) {
LOG.warn(
"The log end offset {} is not equal to the expected log offset {}.",
logEndOffset,
logOffset);
}
return logAppendInfo;
return logTablet.appendAsLeader(walBuilder.build());
} else {
return new LogAppendInfo(
logEndOffsetOfPrevBatch - 1,
Expand All @@ -350,7 +341,6 @@ public LogAppendInfo putAsLeader(
false);
}
} catch (Throwable t) {
LOG.warn("logEndOffsetOfPrevBatch: {}", logEndOffsetOfPrevBatch);
// While encounter error here, the CDC logs may fail writing to disk,
// and the client probably will resend the batch. If we do not remove the
// values generated by the erroneous batch from the kvPreWriteBuffer, the
Expand Down
16 changes: 9 additions & 7 deletions fluss-server/src/test/resources/log4j2-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

# Set root logger level to OFF to not flood build logs
# set manually to INFO for debugging purposes
rootLogger.level=ERROR
rootLogger.appenderRef.test.ref=TestLogger
appender.testlogger.name=TestLogger
appender.testlogger.type=CONSOLE
appender.testlogger.target=SYSTEM_ERR
appender.testlogger.layout.type=PatternLayout
appender.testlogger.layout.pattern=%-4r [%t] %-5p %c %x - %m%n
rootLogger.level = OFF
rootLogger.appenderRef.test.ref = TestLogger

appender.testlogger.name = TestLogger
appender.testlogger.type = CONSOLE
appender.testlogger.target = SYSTEM_ERR
appender.testlogger.layout.type = PatternLayout
appender.testlogger.layout.pattern = %-4r [%t] %-5p %c %x - %m%n

9 changes: 4 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand Down Expand Up @@ -537,7 +537,7 @@
limitations under the License.
-->
<license
implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
<licenseFamilyCategory>AL2</licenseFamilyCategory>
<licenseFamilyName>Apache License 2.0</licenseFamilyName>
<notes/>
Expand Down Expand Up @@ -660,7 +660,6 @@
<exclude>${test.unit.pattern}</exclude>
</excludes>
<reuseForks>false</reuseForks>
<forkCount>1</forkCount>
</configuration>
</execution>
</executions>
Expand Down Expand Up @@ -825,10 +824,10 @@
<transformers combine.children="append">
<!-- The service transformer is needed to merge META-INF/services files -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<!-- The ApacheNoticeResourceTransformer collects and aggregates NOTICE files -->
<transformer
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer">
<projectName>Fluss</projectName>
<encoding>UTF-8</encoding>
</transformer>
Expand Down

0 comments on commit 61b53ec

Please sign in to comment.