From 61b53ec2565a60f293107f70bb2bff43a9d60650 Mon Sep 17 00:00:00 2001 From: yuxia Luo Date: Tue, 31 Dec 2024 12:30:59 +0800 Subject: [PATCH] Revert "Ci debug (#293)" (#294) This reverts commit c6f8a82bf4346fe4f644d67474311e5f8d923ed6. --- .github/workflows/ci.yaml | 2 -- .../fluss/client/table/FlussTable.java | 4 --- .../table/FlussPartitionedTableITCase.java | 36 ++++++------------- .../fluss/client/table/FlussTableITCase.java | 23 ++---------- .../src/test/resources/log4j2-test.properties | 16 +++++---- .../com/alibaba/fluss/cluster/Cluster.java | 26 -------------- .../src/test/resources/log4j2-test.properties | 16 +++++---- .../com/alibaba/fluss/server/kv/KvTablet.java | 12 +------ .../src/test/resources/log4j2-test.properties | 16 +++++---- pom.xml | 9 +++-- 10 files changed, 45 insertions(+), 115 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8a32f0c84..ba2f3ea02 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,8 +20,6 @@ on: - main - release-** - ci-** - schedule: - - cron: '0 * * * *' pull_request: paths-ignore: - 'website/**' diff --git a/fluss-client/src/main/java/com/alibaba/fluss/client/table/FlussTable.java b/fluss-client/src/main/java/com/alibaba/fluss/client/table/FlussTable.java index bd4b709cb..16dc10e09 100644 --- a/fluss-client/src/main/java/com/alibaba/fluss/client/table/FlussTable.java +++ b/fluss-client/src/main/java/com/alibaba/fluss/client/table/FlussTable.java @@ -370,10 +370,6 @@ public UpsertWriter getUpsertWriter(UpsertWrite upsertWrite) { metadataUpdater); } - public MetadataUpdater getMetadataUpdater() { - return metadataUpdater; - } - @Override public UpsertWriter getUpsertWriter() { return getUpsertWriter(new UpsertWrite()); diff --git a/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussPartitionedTableITCase.java b/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussPartitionedTableITCase.java index da614dbe6..09e16589d 100644 --- a/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussPartitionedTableITCase.java +++ b/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussPartitionedTableITCase.java @@ -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; @@ -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; @@ -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); @@ -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 diff --git a/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussTableITCase.java b/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussTableITCase.java index 423a7d1c4..48abf51c8 100644 --- a/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussTableITCase.java +++ b/fluss-client/src/test/java/com/alibaba/fluss/client/table/FlussTableITCase.java @@ -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; @@ -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; @@ -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); @@ -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 { diff --git a/fluss-client/src/test/resources/log4j2-test.properties b/fluss-client/src/test/resources/log4j2-test.properties index d3bf7a2da..326681daa 100644 --- a/fluss-client/src/test/resources/log4j2-test.properties +++ b/fluss-client/src/test/resources/log4j2-test.properties @@ -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 diff --git a/fluss-common/src/main/java/com/alibaba/fluss/cluster/Cluster.java b/fluss-common/src/main/java/com/alibaba/fluss/cluster/Cluster.java index 6c896ecae..f6a630cce 100644 --- a/fluss-common/src/main/java/com/alibaba/fluss/cluster/Cluster.java +++ b/fluss-common/src/main/java/com/alibaba/fluss/cluster/Cluster.java @@ -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 - + '}'; - } } diff --git a/fluss-connectors/fluss-connector-flink/src/test/resources/log4j2-test.properties b/fluss-connectors/fluss-connector-flink/src/test/resources/log4j2-test.properties index eda623f40..8eff1ee31 100644 --- a/fluss-connectors/fluss-connector-flink/src/test/resources/log4j2-test.properties +++ b/fluss-connectors/fluss-connector-flink/src/test/resources/log4j2-test.properties @@ -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 diff --git a/fluss-server/src/main/java/com/alibaba/fluss/server/kv/KvTablet.java b/fluss-server/src/main/java/com/alibaba/fluss/server/kv/KvTablet.java index 9a6362024..7dc740cec 100644 --- a/fluss-server/src/main/java/com/alibaba/fluss/server/kv/KvTablet.java +++ b/fluss-server/src/main/java/com/alibaba/fluss/server/kv/KvTablet.java @@ -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, @@ -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 diff --git a/fluss-server/src/test/resources/log4j2-test.properties b/fluss-server/src/test/resources/log4j2-test.properties index 416812f16..8eff1ee31 100644 --- a/fluss-server/src/test/resources/log4j2-test.properties +++ b/fluss-server/src/test/resources/log4j2-test.properties @@ -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 diff --git a/pom.xml b/pom.xml index 9b3f35e15..09884d9fb 100644 --- a/pom.xml +++ b/pom.xml @@ -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, @@ -537,7 +537,7 @@ limitations under the License. --> + implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense"> AL2 Apache License 2.0 @@ -660,7 +660,6 @@ ${test.unit.pattern} false - 1 @@ -825,10 +824,10 @@ + implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/> + implementation="org.apache.maven.plugins.shade.resource.ApacheNoticeResourceTransformer"> Fluss UTF-8