From e271f7a8a193fd04495848b70344c35cc3bb977f Mon Sep 17 00:00:00 2001 From: congyi <15605187270@163.com> Date: Thu, 7 Mar 2024 16:00:29 +0800 Subject: [PATCH] add comments --- risingwave-test/hummock_001/checkpoint/0 | Bin 115 -> 115 bytes .../src/hummock/event_handler/uploader.rs | 5 ++--- src/stream/tests/integration_tests/snapshot.rs | 2 ++ 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/risingwave-test/hummock_001/checkpoint/0 b/risingwave-test/hummock_001/checkpoint/0 index c30b3346f6bc8d7ad606e6b008cd90942f39734b..cd919182374737f429d94c8e70fc5608155be10e 100644 GIT binary patch delta 27 jcmXReX5}j6IA=bQHJ*P?&(dX&xfB{29{lfF@R$n#kC6-T delta 27 icmXReX5}j6xU4XdHJ<;%p6d%9b15`5Jow)OWB>q`91Ly% diff --git a/src/storage/src/hummock/event_handler/uploader.rs b/src/storage/src/hummock/event_handler/uploader.rs index 56de7f7e60fa9..b59ff6436fdba 100644 --- a/src/storage/src/hummock/event_handler/uploader.rs +++ b/src/storage/src/hummock/event_handler/uploader.rs @@ -1211,7 +1211,6 @@ mod tests { use crate::opts::StorageOpts; use crate::storage_value::StorageValue; - const BASIC_EPOCH: HummockEpoch = test_epoch(4); const INITIAL_EPOCH: HummockEpoch = test_epoch(5); const TEST_TABLE_ID: TableId = TableId { table_id: 233 }; @@ -1231,7 +1230,7 @@ mod tests { } fn initial_pinned_version() -> PinnedVersion { - PinnedVersion::new(test_hummock_version(BASIC_EPOCH), unbounded_channel().0) + PinnedVersion::new(test_hummock_version(INITIAL_EPOCH), unbounded_channel().0) } fn dummy_table_key() -> Vec { @@ -1404,7 +1403,7 @@ mod tests { #[tokio::test] async fn test_uploader_basic() { let mut uploader = test_uploader(dummy_success_upload_future); - let epoch1 = INITIAL_EPOCH; + let epoch1 = INITIAL_EPOCH.next_epoch(); let imm = gen_imm(epoch1).await; uploader.add_imm(imm.clone()); assert_eq!(1, uploader.unsealed_data.len()); diff --git a/src/stream/tests/integration_tests/snapshot.rs b/src/stream/tests/integration_tests/snapshot.rs index 5280fd48f5865..88d1afac34b29 100644 --- a/src/stream/tests/integration_tests/snapshot.rs +++ b/src/stream/tests/integration_tests/snapshot.rs @@ -199,6 +199,8 @@ fn run_until_pending( } SnapshotEvent::Chunk(output) } + // The epoch value in the input is randomly chosen (e.g., 1, 2, 3), but during the actual processing, it undergoes a left shift. + // In order to ensure consistency between the input and output when comparing with the script, the epoch value in the output needs to be correspondingly right-shifted. Message::Barrier(barrier) => SnapshotEvent::Barrier(barrier.epoch.curr / test_epoch(1)), Message::Watermark(watermark) => SnapshotEvent::Watermark { col_idx: watermark.col_idx,