[opt](cloud) Enable compaction on new tablets during schema change queuing#61089
Draft
Yukang-Lian wants to merge 1 commit intoapache:masterfrom
Draft
[opt](cloud) Enable compaction on new tablets during schema change queuing#61089Yukang-Lian wants to merge 1 commit intoapache:masterfrom
Yukang-Lian wants to merge 1 commit intoapache:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Summary
In cloud mode, schema change (SC) tasks for multi-tablet tables are submitted to a thread pool with limited workers. Tablets waiting in the queue cannot do compaction because their
alter_versionis unset (-1), which causes rowsetaccumulation during long queue waits.
This PR sets
alter_version = V0(from FE request) on new tablets at task pre-submit time (before enqueue), so that queued new tablets can perform cumulative compaction on double-write data (versions > V0) while waiting.Changes
BE only — no FE or meta-service changes.
task_worker_pool.h/cpp: Addpre_submit_callbacktoTaskWorkerPool, invoked synchronously before task enters the thread pool queue.task_worker_pool.cpp: Implementset_alter_version_before_enqueue()— setsalter_version = V0on both base and new tablets before enqueue. Add unconditionalalter_versioncleanup inalter_cloud_tablet_callback().agent_server.cpp: Wire upset_alter_version_before_enqueueas pre_submit_callback for the ALTER worker pool.Key Design Points
alter_versionis reset to -1 beforeremove_task_infoto prevent race with same-signature re-submission.Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)