Skip to content

Commit ae67d1a

Browse files
authored
[hotfix] Fix data freshness don't work issue (#1090)
1 parent 3ed3988 commit ae67d1a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

fluss-server/src/main/java/com/alibaba/fluss/server/coordinator/LakeTableTieringManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ private void doHandleStateChange(long tableId, TieringState targetState) {
390390
liveTieringTableIds.put(tableId, clock.milliseconds());
391391
break;
392392
case Tiered:
393+
tableLastTieredTime.put(tableId, clock.milliseconds());
394+
liveTieringTableIds.remove(tableId);
395+
break;
393396
case Failed:
394397
liveTieringTableIds.remove(tableId);
395398
// do nothing

fluss-server/src/test/java/com/alibaba/fluss/server/coordinator/LakeTableTieringManagerTest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,13 @@ void testFinishTableTieringReTriggerSchedule() {
155155
// not advance time, request table should return null
156156
assertThat(tableTieringManager.requestTable()).isNull();
157157

158-
// now, advance time to trigger the table tiering
159-
manualClock.advanceTime(Duration.ofSeconds(10));
158+
// now, advance 1 second to trigger the table tiering
159+
manualClock.advanceTime(Duration.ofSeconds(4));
160+
// not reach data freshness, shouldn't request table
161+
assertThat(tableTieringManager.requestTable()).isNull();
162+
163+
// advance 6 seconds again, should get table now
164+
manualClock.advanceTime(Duration.ofSeconds(6));
160165
// the tiered epoch should be 2 now
161166
assertRequestTable(tableId1, tablePath1, 2);
162167
}

0 commit comments

Comments
 (0)