Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(storage): use an in-memory meta node to do the replay process locally #6041

Merged
merged 10 commits into from
Oct 31, 2022

Conversation

StrikeW
Copy link
Contributor

@StrikeW StrikeW commented Oct 26, 2022

I hereby agree to the terms of the Singularity Data, Inc. Contributor License Agreement.

What's changed and what's your intention?

This PR makes the compaction test tool decouples from the Meta in the cluster being tested, to make the tool self-contained.

  1. Pull necessary metadata (Table catalog and compaction groups) from the original meta and apply to the new meta
  2. Pull version delta logs from the original meta
  3. Replay delta logs to the new meta and trigger compactions locally

Checklist

  • I have written necessary rustdoc comments
  • I have added necessary unit tests and integration tests
  • All checks passed in ./risedev check (or alias, ./risedev c)

Documentation

If your pull request contains user-facing changes, please specify the types of the changes, and create a release note. Otherwise, please feel free to remove this section.

Types of user-facing changes

Please keep the types that apply to your changes, and remove those that do not apply.

  • Installation and deployment
  • Connector (sources & sinks)
  • SQL commands, functions, and operators
  • RisingWave cluster configuration changes
  • Other (please specify in the release note below)

Release note

Please create a release note for your changes. In the release note, focus on the impact on users, and mention the environment or conditions where the impact may occur.

Refer to a related PR or issue link (optional)

#5464

@StrikeW StrikeW marked this pull request as draft October 26, 2022 08:27
@StrikeW StrikeW requested review from zwang28 and hzxa21 October 26, 2022 08:27
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #6041 (778fe97) into main (49cc50d) will increase coverage by 0.08%.
The diff coverage is 32.52%.

@@            Coverage Diff             @@
##             main    #6041      +/-   ##
==========================================
+ Coverage   74.70%   74.79%   +0.08%     
==========================================
  Files         933      931       -2     
  Lines      149025   148812     -213     
==========================================
- Hits       111330   111297      -33     
+ Misses      37695    37515     -180     
Flag Coverage Δ
rust 74.79% <32.52%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...rc/ctl/src/cmd_impl/hummock/list_version_deltas.rs 0.00% <0.00%> (ø)
src/frontend/src/handler/query.rs 18.75% <0.00%> (-0.78%) ⬇️
src/frontend/src/optimizer/plan_node/stream.rs 54.71% <0.00%> (-1.60%) ⬇️
src/meta/src/hummock/compaction_group/manager.rs 66.55% <0.00%> (-11.01%) ⬇️
src/meta/src/hummock/manager/mod.rs 73.27% <0.00%> (-1.49%) ⬇️
src/meta/src/lib.rs 0.92% <0.00%> (-0.04%) ⬇️
src/meta/src/rpc/service/hummock_service.rs 3.64% <0.00%> (-0.12%) ⬇️
src/rpc_client/src/meta_client.rs 0.00% <0.00%> (ø)
src/utils/pgwire/src/error.rs 0.00% <ø> (ø)
src/utils/pgwire/src/pg_protocol.rs 57.39% <0.00%> (-0.26%) ⬇️
... and 21 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@StrikeW
Copy link
Contributor Author

StrikeW commented Oct 27, 2022

After I merge main branch, the tool will fail to fetch rows from iter after compaction (if I don't trigger compactions it can read rows). And the test tool on the main branch can reproduce the same problem. I suspect that it is related to the recent refactoring of the hummock (my branch doesn't switch to the new hummock #5902). Could you take a look? @hzxa21 @wenym1 We can further discuss the problem on Slack.

     Running `target/debug/compaction-test --state-store 'hummock+s3://siyuanw-test-bucket' -t 1004`
2022-10-26T16:12:16.963787Z  INFO risingwave_rt: parking lot deadlock detection enabled
2022-10-26T16:12:16.966826Z  INFO risingwave_compaction_test: Compaction test start with options CompactionTestOpts { host: "127.0.0.1:6660", client_address: None, state_store: "hummock+s3://siyuanw-test-bucket", meta_address: "http://127.0.0.1:5790", config_path: "", table_id: 1004, num_trigger_frequency: 10, num_trigger_rounds: 3 }
2022-10-26T16:12:16.967158Z  INFO risingwave_compaction_test: Server Listening at 127.0.0.1:6660
2022-10-26T16:12:16.967216Z  WARN risingwave_compaction_test: Client address is not specified, defaulting to host address
2022-10-26T16:12:16.972176Z  WARN risingwave_common::config: risingwave.toml not found, using default config.

2022-10-26T16:12:16.972880Z  INFO risingwave_meta: Starting meta node with config MetaNodeConfig { streaming: StreamingConfig { barrier_interval_ms: 250, in_flight_barrier_nums: 40, checkpoint_frequency: 10, minimal_scheduling: false, worker_node_parallelism: 10, actor_runtime_worker_threads_num: None, total_memory_available_bytes: 34359738368, developer: DeveloperConfig { batch_output_channel_size: 64, batch_chunk_size: 1024, stream_enable_executor_row_count: false, stream_connector_message_buffer_size: 16, unsafe_stream_hash_agg_cache_size: 65536, unsafe_stream_join_cache_size: 65536, unsafe_stream_extreme_cache_size: 1024, stream_chunk_size: 1024 } } }

2022-10-26T16:12:16.972998Z  INFO risingwave_meta: Starting meta node with options periodic_compaction_interval_sec: 999999, enable_compaction_deterministic: true
2022-10-26T16:12:16.973111Z  INFO risingwave_meta: Meta server listening at 127.0.0.1:5790
2022-10-26T16:12:16.992695Z  INFO risingwave_meta::barrier::schedule: Starting barrier scheduler with: checkpoint_frequency=10
2022-10-26T16:12:16.992910Z  INFO risingwave_meta::barrier: Starting barrier manager with: interval=250ms, enable_recovery=true, in_flight_barrier_nums=40
2022-10-26T16:12:16.994321Z  INFO risingwave_meta::hummock::compaction_scheduler: Start compaction scheduler.
2022-10-26T16:12:16.995868Z  WARN risingwave_common::util::epoch: New generate epoch is too close to the previous one.
2022-10-26T16:12:17.971001Z  INFO risingwave_compaction_test::server: Started embedded Meta
2022-10-26T16:12:17.971451Z  INFO risingwave_compaction_test::server: Started compactor thread
2022-10-26T16:12:17.981357Z  INFO risingwave_compactor: meta address: http://127.0.0.1:5790
2022-10-26T16:12:17.981502Z  INFO risingwave_compactor: Server Listening at 127.0.0.1:5550
2022-10-26T16:12:17.981694Z  INFO risingwave_compactor: Client address is 127.0.0.1:6660
2022-10-26T16:12:17.981775Z  WARN risingwave_common::config: risingwave.toml not found, using default config.

2022-10-26T16:12:17.981913Z  INFO risingwave_compactor::server: Starting compactor with config CompactorConfig { server: ServerConfig { heartbeat_interval_ms: 1000, connection_pool_size: 16 }, storage: StorageConfig { sstable_size_mb: 256, block_size_kb: 1024, bloom_false_positive: 0.01, share_buffers_sync_parallelism: 1, share_buffer_compaction_worker_threads_number: 4, shared_buffer_capacity_mb: 1024, data_directory: "hummock_001", write_conflict_detection_enabled: true, block_cache_capacity_mb: 256, meta_cache_capacity_mb: 64, disable_remote_compactor: false, enable_local_spill: true, local_object_store: "tempdisk", share_buffer_upload_concurrency: 8, compactor_memory_limit_mb: 512, sstable_id_remote_fetch_number: 10, file_cache: FileCacheConfig { capacity_mb: 1024, total_buffer_capacity_mb: 128, cache_file_fallocate_unit_mb: 512, cache_meta_fallocate_unit_mb: 16, cache_file_max_write_size_mb: 4 }, min_sst_size_for_streaming_upload: 33554432, max_sub_compaction: 4 } } and opts CompactorOpts { host: "127.0.0.1:5550", client_address: Some("127.0.0.1:6660"), port: None, state_store: "hummock+s3://siyuanw-test-bucket", prometheus_listener_addr: "127.0.0.1:1260", metrics_level: 0, meta_address: "http://127.0.0.1:5790", config_path: "", max_concurrent_task_number: 16, compaction_worker_threads_number: None }

2022-10-26T16:12:17.998095Z  INFO risingwave_compaction_test::server: Assigned pull worker id 3
2022-10-26T16:12:17.998098Z  INFO risingwave_compactor::server: Assigned compactor id 1

2022-10-26T16:12:18.012743Z  INFO risingwave_meta::hummock::compaction_group::manager: Compaction group 2, registered table ids [1006, 1010, 1009, 1012, 1011, 1008, 1005, 1007]
2022-10-26T16:12:18.012850Z  INFO risingwave_meta::hummock::compaction_group::manager: Compaction group 3, registered table ids [1004]
2022-10-26T16:12:18.013473Z  INFO risingwave_meta::hummock::manager: Inited compaction groups:
2022-10-26T16:12:18.013492Z  INFO risingwave_meta::hummock::manager: CompactionGroup { group_id: 2, parent_group_id: 0, member_table_ids: {1010, 1006, 1005, 1008, 1011, 1007, 1012, 1009}, compaction_config: CompactionConfig { max_bytes_for_level_base: 536870912, max_level: 6, max_bytes_for_level_multiplier: 10, max_compaction_bytes: 2147483648, sub_level_max_compaction_bytes: 268435456, level0_trigger_file_number: 16, level0_tier_compact_file_number: 8, compaction_mode: Range, compression_algorithm: ["None", "None", "None", "Lz4", "Lz4", "Zstd", "Zstd"], target_file_size_base: 33554432, compaction_filter_mask: 6, max_sub_compaction: 4 }, table_id_to_options: {1008: TableOption { retention_seconds: None }, 1007: TableOption { retention_seconds: None }, 1011: TableOption { retention_seconds: None }, 1005: TableOption { retention_seconds: None }, 1010: TableOption { retention_seconds: None }, 1006: TableOption { retention_seconds: None }, 1009: TableOption { retention_seconds: None }, 1012: TableOption { retention_seconds: None }} }
2022-10-26T16:12:18.013566Z  INFO risingwave_meta::hummock::manager: CompactionGroup { group_id: 3, parent_group_id: 0, member_table_ids: {1004}, compaction_config: CompactionConfig { max_bytes_for_level_base: 536870912, max_level: 6, max_bytes_for_level_multiplier: 10, max_compaction_bytes: 2147483648, sub_level_max_compaction_bytes: 268435456, level0_trigger_file_number: 16, level0_tier_compact_file_number: 8, compaction_mode: Range, compression_algorithm: ["None", "None", "None", "Lz4", "Lz4", "Zstd", "Zstd"], target_file_size_base: 33554432, compaction_filter_mask: 6, max_sub_compaction: 4 }, table_id_to_options: {1004: TableOption { retention_seconds: None }} }

2022-10-26T16:12:18.014240Z  INFO risingwave_compaction_test::server: Finished init new Meta for replay
2022-10-26T16:12:18.016778Z  INFO risingwave_compaction_test::server: Assigned pull worker id 3
2022-10-26T16:12:18.022696Z  INFO risingwave_rpc_client::meta_client: Heartbeat loop is stopped
2022-10-26T16:12:18.022788Z  INFO risingwave_compaction_test::server: Shutdown the pull worker
2022-10-26T16:12:18.022810Z  INFO risingwave_compaction_test::server: Pulled delta logs from Meta: len(logs): 75
2022-10-26T16:12:18.023207Z  INFO risingwave_compaction_test::server: Start to replay. Client address is 127.0.0.1:7770
2022-10-26T16:12:18.023232Z  WARN risingwave_common::config: risingwave.toml not found, using default config.
2022-10-26T16:12:18.023267Z  INFO risingwave_compaction_test::server: Starting replay with config TestToolConfig { server: ServerConfig { heartbeat_interval_ms: 1000, connection_pool_size: 16 }, storage: StorageConfig { sstable_size_mb: 256, block_size_kb: 1024, bloom_false_positive: 0.01, share_buffers_sync_parallelism: 1, share_buffer_compaction_worker_threads_number: 4, shared_buffer_capacity_mb: 1024, data_directory: "hummock_001", write_conflict_detection_enabled: true, block_cache_capacity_mb: 256, meta_cache_capacity_mb: 64, disable_remote_compactor: false, enable_local_spill: true, local_object_store: "tempdisk", share_buffer_upload_concurrency: 8, compactor_memory_limit_mb: 512, sstable_id_remote_fetch_number: 10, file_cache: FileCacheConfig { capacity_mb: 1024, total_buffer_capacity_mb: 128, cache_file_fallocate_unit_mb: 512, cache_meta_fallocate_unit_mb: 16, cache_file_max_write_size_mb: 4 }, min_sst_size_for_streaming_upload: 33554432, max_sub_compaction: 4 } } and opts CompactionTestOpts { host: "127.0.0.1:6660", client_address: None, state_store: "hummock+s3://siyuanw-test-bucket", meta_address: "http://127.0.0.1:5790", config_path: "", table_id: 1004, num_trigger_frequency: 10, num_trigger_rounds: 3 }
2022-10-26T16:12:18.026494Z  INFO risingwave_compaction_test::server: Assigned replay worker id 2
2022-10-26T16:12:20.000914Z  INFO risingwave_object_store::object::s3: S3 bucket siyuanw-test-bucket has already configured AbortIncompleteMultipartUpload: [LifecycleRule { expiration: None, id: Some("abort-incomplete-multipart-upload"), prefix: None, filter: Some(Prefix("")), status: Some(Enabled), transitions: None, noncurrent_version_transitions: None, noncurrent_version_expiration: None, abort_incomplete_multipart_upload: Some(AbortIncompleteMultipartUpload { days_after_initiation: 1 }) }]
2022-10-26T16:12:20.004120Z  INFO risingwave_object_store::object::s3: S3 bucket siyuanw-test-bucket has already configured AbortIncompleteMultipartUpload: [LifecycleRule { expiration: None, id: Some("abort-incomplete-multipart-upload"), prefix: None, filter: Some(Prefix("")), status: Some(Enabled), transitions: None, noncurrent_version_transitions: None, noncurrent_version_expiration: None, abort_incomplete_multipart_upload: Some(AbortIncompleteMultipartUpload { days_after_initiation: 1 }) }]
2022-10-26T16:12:20.016103Z  INFO risingwave_meta::hummock::compactor_manager: Added compactor session 1
2022-10-26T16:12:20.017014Z DEBUG risingwave_storage::hummock::compactor: Succeeded subscribe_compact_tasks.
2022-10-26T16:12:20.020874Z  INFO risingwave_tracing: tracing service started with slow_request_threshold_ms=100
2022-10-26T16:12:20.023777Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 2, max_committed_epoch: 0, compaction_groups: [2, 3]
2022-10-26T16:12:20.025699Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 3, max_committed_epoch: 3248047401402369, compaction_groups: []
2022-10-26T16:12:20.027246Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 4, max_committed_epoch: 3248067051913216, compaction_groups: [2, 3]
2022-10-26T16:12:20.029197Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 5, max_committed_epoch: 3248067232137216, compaction_groups: [3, 2]
2022-10-26T16:12:20.030608Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 6, max_committed_epoch: 3248067412885504, compaction_groups: [3, 2]
2022-10-26T16:12:20.032020Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 7, max_committed_epoch: 3248067593306112, compaction_groups: [3, 2]
2022-10-26T16:12:20.033472Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 8, max_committed_epoch: 3248067773464576, compaction_groups: [2, 3]
2022-10-26T16:12:20.034881Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 9, max_committed_epoch: 3248067954475008, compaction_groups: [2, 3]
2022-10-26T16:12:20.036317Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 10, max_committed_epoch: 3248068136075264, compaction_groups: [2, 3]
2022-10-26T16:12:20.037665Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 11, max_committed_epoch: 3248068316299264, compaction_groups: []
2022-10-26T16:12:22.039192Z  INFO risingwave_compaction_test::server: Trigger compaction for version 11, epoch 3248068316299264 compaction_groups: {2, 3}
2022-10-26T16:12:22.040649Z  INFO risingwave_meta::hummock::manager: Trigger compaction for version 11, epoch 3248068316299264, groups [2, 3]
2022-10-26T16:12:22.096100Z  INFO risingwave_meta::hummock::manager: Trigger compaction for version 11, epoch 3248068316299264, groups [2, 3]
2022-10-26T16:12:22.149253Z  INFO risingwave_meta::hummock::manager: Trigger compaction for version 11, epoch 3248068316299264, groups [2, 3]
2022-10-26T16:12:24.716906Z  INFO risingwave_compaction_test::server: Compaction schedule_ok false, version_diff 0
2022-10-26T16:12:30.389853Z  INFO risingwave_compaction_test::server: Compaction schedule_ok false, version_diff 0 compaction_ok false
2022-10-26T16:12:30.393273Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 12, max_committed_epoch: 3248068496523264, compaction_groups: [2]
2022-10-26T16:12:30.396073Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 13, max_committed_epoch: 3248068676812800, compaction_groups: [3, 2]
2022-10-26T16:12:30.398362Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 14, max_committed_epoch: 3248068856971264, compaction_groups: [2, 3]
2022-10-26T16:12:30.400436Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 15, max_committed_epoch: 3248069037260800, compaction_groups: []
2022-10-26T16:12:30.402466Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 16, max_committed_epoch: 3248069217484800, compaction_groups: []
2022-10-26T16:12:30.404451Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 17, max_committed_epoch: 3248069397643264, compaction_groups: [2, 3]
2022-10-26T16:12:30.406512Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 18, max_committed_epoch: 3248069577867264, compaction_groups: [3, 2]
2022-10-26T16:12:30.408448Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 19, max_committed_epoch: 3248069758091264, compaction_groups: []
2022-10-26T16:12:30.410423Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 20, max_committed_epoch: 3248069938315264, compaction_groups: []
2022-10-26T16:12:30.412491Z  INFO risingwave_compaction_test::server: Replayed version delta version_id: 21, max_committed_epoch: 3248070250790912, compaction_groups: [3, 2]
2022-10-26T16:12:31.071171Z  INFO risingwave_compaction_test::server: Trigger compaction for version 21, epoch 3248070250790912 compaction_groups: {2, 3}
2022-10-26T16:12:31.073126Z  INFO risingwave_meta::hummock::manager: Trigger compaction for version 21, epoch 3248070250790912, groups [2, 3]
2022-10-26T16:12:31.075099Z  INFO risingwave_meta::hummock::metrics_utils: Level 0 has 13 SSTs, the total size of which is 47149KB, while 13 of those are being compacted to bottom levels
2022-10-26T16:12:31.075135Z  INFO risingwave_meta::hummock::metrics_utils: Level 1 has 0 SSTs, the total size of which is 0KB, while 0 of those are being compacted to bottom levels
2022-10-26T16:12:31.075150Z  INFO risingwave_meta::hummock::metrics_utils: Level 2 has 0 SSTs, the total size of which is 0KB, while 0 of those are being compacted to bottom levels
2022-10-26T16:12:31.075164Z  INFO risingwave_meta::hummock::metrics_utils: Level 3 has 0 SSTs, the total size of which is 0KB, while 0 of those are being compacted to bottom levels
2022-10-26T16:12:31.075177Z  INFO risingwave_meta::hummock::metrics_utils: Level 4 has 0 SSTs, the total size of which is 0KB, while 0 of those are being compacted to bottom levels
2022-10-26T16:12:31.075650Z  INFO risingwave_meta::hummock::metrics_utils: Level 5 has 0 SSTs, the total size of which is 0KB, while 0 of those are being compacted to bottom levels
2022-10-26T16:12:31.075687Z  INFO risingwave_meta::hummock::metrics_utils: Level 6 has 0 SSTs, the total size of which is 0KB, while 0 of those are being compacted to bottom levels

2022-10-26T16:12:31.085386Z  INFO risingwave_storage::hummock::compactor: Ready to handle compaction task: 10 need memory: 48281151
2022-10-26T16:12:31.085583Z  INFO risingwave_storage::hummock::compactor: Ready to handle compaction task: 11 need memory: 11742468

2022-10-26T16:12:31.127428Z  INFO risingwave_meta::hummock::manager: Trigger compaction for version 21, epoch 3248070250790912, groups [2, 3]
2022-10-26T16:12:31.179801Z  INFO risingwave_meta::hummock::manager: Trigger compaction for version 21, epoch 3248070250790912, groups [2, 3]
2022-10-26T16:12:33.535670Z  INFO risingwave_compaction_test::server: Compaction schedule_ok false, version_diff 0
2022-10-26T16:12:36.526097Z  INFO risingwave_storage::hummock::compactor: Finished compaction task in 5440.396083ms:
Compaction task id: 11, target level: 0
Compaction watermark: 0
Compaction target_file_size: 33554432
Compaction # splits: 1
Compaction task status: 2
Compaction Sstables structure:
Level 0 ["[id: 21, 0KB]"]
Level 0 ["[id: 19, 0KB]"]
Level 0 ["[id: 17, 0KB]"]
Level 0 ["[id: 15, 0KB]"]
Level 0 ["[id: 13, 0KB]"]
Level 0 ["[id: 10, 0KB]"]
Level 0 ["[id: 8, 0KB]"]
Level 0 ["[id: 7, 0KB]"]
Level 0 ["[id: 5, 0KB]"]
Level 0 ["[id: 3, 3036KB]"]
Level 0 ["[id: 2, 4553KB]"]
Level 0 ["[id: 1, 3872KB]"]
Compaction task output:
SstableInfo: id=1000000, KeyRange=["000003ec100082e2867b06c0023f008000000055a5a2a8000000000085f5adf80085f5adf8fff475e5b67effff","000003ec850082e28661510000bc008000000055a5a28a000000000085f5ce900085f5ce90fff475e67b05ffff"], size=4KB, delete_ratio=92%

2022-10-26T16:12:36.544437Z  INFO risingwave_compaction_test::server: Collected all of compact tasks. Actual version diff 1
2022-10-26T16:12:36.544472Z  INFO risingwave_compaction_test::server: Compaction schedule_ok false, version_diff 0 compaction_ok true
2022-10-26T16:12:36.752426Z  INFO risingwave_compaction_test::server: Check results for version: id: 22, epoch: 3248069938315264
thread '<unnamed>' panicked at 'called `Option::unwrap()` on a `None` value', src/tests/compaction_test/src/server.rs:564:55
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[1]    18503 abort      cargo run --bin compaction-test -- --state-store  -t 1004

@StrikeW StrikeW force-pushed the siyuan/compaction-test-enhance branch from a0024e5 to 5d12c0a Compare October 27, 2022 03:22
@StrikeW StrikeW force-pushed the siyuan/compaction-test-enhance branch from 1900c40 to 7014c17 Compare October 28, 2022 08:35
@StrikeW
Copy link
Contributor Author

StrikeW commented Oct 29, 2022

TheStateStore::iter interface of doesn't scan rows of the specified table (#6104), so the number of rows mismatch.

@StrikeW StrikeW marked this pull request as ready for review October 29, 2022 04:37
Copy link
Contributor

@zwang28 zwang28 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest LGTM

@@ -81,6 +81,9 @@ pub struct MetaOpts {
/// Whether run in compaction detection test mode
pub compaction_deterministic_test: bool,

/// Start id of SST table file. See [`IdGeneratorManager`] for details.
pub sst_id_start: Option<u64>,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For a cluster, this option is actually used only once when initialized first time and is ignored later. Can we avoid this option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to shift the start sst_id of the embedded Meta node to avoid id conflicts with the original Meta. Any alternatives?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call get_new_sst_ids to explicitly fetch then throw away certain sst ids?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. I don't get it. Do you mean we should add this logic to the compactor when runs in the deterministic mode?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline, will fix it in the next PR.

@mergify mergify bot merged commit 9f9fab7 into main Oct 31, 2022
@mergify mergify bot deleted the siyuan/compaction-test-enhance branch October 31, 2022 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants