Skip to content

refactor(compaction): refactor compaction event stream #21669

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

Merged
merged 12 commits into from
May 9, 2025

Conversation

Li0k
Copy link
Contributor

@Li0k Li0k commented Apr 30, 2025

I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.

What's changed and what's your intention?

  1. Refactor the compaction event loop framework.
  2. Introduce the Iceberg compactor manager.
  3. Support the Iceberg event stream.

Note that this PR is just the framework, not the full implementation. Subsequent updates will introduce the complete implementation.

Checklist

  • I have written necessary rustdoc comments.
  • I have added necessary unit tests and integration tests.
  • I have added test labels as necessary.
  • I have added fuzzing tests or opened an issue to track them.
  • My PR contains breaking changes.
  • My PR changes performance-critical code, so I will run (micro) benchmarks and present the results.
  • I have checked the Release Timeline and Currently Supported Versions to determine which release branches I need to cherry-pick this PR into.

Documentation

  • My PR needs documentation updates.
Release note

@Li0k Li0k requested review from Copilot, chenzl25, xxhZs and zwang28 May 6, 2025 09:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR refactors the compaction event stream by introducing support for a new iceberg compaction event stream alongside the existing implementation. Key changes include:

  • Adding new feature flags and types to support iceberg compaction events.
  • Updating HummockManager and related modules (compaction manager, compactor manager, service, and proto definitions) to handle separate event loops and API endpoints for iceberg compaction.
  • Adjusting test utilities and worker modules to accommodate the new iceberg compactor stream.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/meta/src/lib.rs Added a new feature flag (adt_const_params) required by updated code.
src/meta/src/hummock/test_utils.rs Introduced a new channel for iceberg compactor streams.
src/meta/src/hummock/mock_hummock_meta_client.rs Updated usage of compactor manager API to reflect renaming.
src/meta/src/hummock/manager/worker.rs Added a TODO comment for eventual removal of the iceberg compactor.
src/meta/src/hummock/manager/mod.rs Extended HummockManager with iceberg compactor manager and updated initialization routines.
src/meta/src/hummock/manager/compaction/mod.rs Refactored event loop implementation to include dedicated handlers for both compaction types.
src/meta/src/hummock/compactor_manager.rs Added new iceberg compactor types and traits, along with respective tests.
src/meta/service/src/hummock_service.rs Added a new subscribe API method for iceberg compaction events.
src/meta/node/src/server.rs Integrated the new iceberg compactor stream into service startup.
proto/hummock.proto Added new proto messages for iceberg compaction events.
Comments suppressed due to low confidence (1)

proto/hummock.proto:845

  • [nitpick] Ensure that the field numbering (using 7 for create_at) is intentional and document the rationale, especially if gaps in numbering are reserved for future extensions.
  uint64 create_at = 7;

tokio::select! {
_ = shutdown_rx_shared => { return; },
// TODO(li0k): move this to iceberg compaction manager
// when iceberg compaction manager is ready.
Copy link
Preview

Copilot AI May 6, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider adding a reference to a tracking issue or additional context in this TODO comment to clarify the future plan for migrating this logic into the dedicated iceberg compaction manager.

Suggested change
// when iceberg compaction manager is ready.
// when iceberg compaction manager is ready. See tracking issue #12345
// for details on the migration plan and readiness criteria.

Copilot uses AI. Check for mistakes.

@Li0k Li0k marked this pull request as ready for review May 6, 2025 09:12
@Li0k Li0k added the compaction-test trigger compaction-test on Buildkite label May 6, 2025
@graphite-app graphite-app bot requested a review from a team May 6, 2025 09:58
@risingwave-ci
Copy link

Failed: 0
Passed:1
FailedExecutions:

PassedExecutions:
https://buildkite.com/risingwave-test/compaction-test/builds/346

Copy link
Contributor

@chenzl25 chenzl25 left a comment

Choose a reason for hiding this comment

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

LGTM!

@Li0k Li0k added this pull request to the merge queue May 9, 2025
Merged via the queue into main with commit 5681ced May 9, 2025
32 of 33 checks passed
@Li0k Li0k deleted the li0k/refactor_compact_event_stream branch May 9, 2025 14:49
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.

4 participants