fix: Fix the panic caused by scaling with a single fragment downstream of no shuffle #18581
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.
Signed-off-by: Shanicky Chen peng@risingwave-labs.comI hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This PR fixes an issue that could cause panic during the Scaling process.
As a single fragment downstream of no shuffle, which can also be considered a single actor, it should not need bitmap updates like its upstream. Previously, directly unwrapping would lead to panic.
Theoretically, this should have been discovered by tests (we provided integration tests for single fragments early on), but our integration tests were all changed to arrangement backfill mode, so it was hidden. 🫠
Changes to ScaleController Logic
ScaleController
with a new comment.Single
distribution type have an empty bitmap.Updates to Singleton Migration Tests
test_singleton_migration
to utilize a new helper functiontest_singleton_migration_helper
.Configuration
parameter to facilitate testing with various setups.test_singleton_migration
andtest_singleton_migration_for_no_shuffle
, each utilizing different scale configurations to ensure proper behavior during singleton migrations.These improvements aim to enhance the robustness of the scale controller's logic in a stream-processing framework, and to increase the flexibility of testing by accommodating different singleton migration scenarios. Code maintainability and error handling have also been addressed, streamlining the future development and debugging processes.
Checklist
./risedev check
(or alias,./risedev c
)