Skip to content

Conversation

@J-HowHuang
Copy link
Collaborator

Description

It was revealed a risk of data loss for pauseless tables during rebalance, when downtime=true or minAvailableReplicas=0.
If a segment is being moved and has not yet uploaded to deep store, premature deletion could cause irrecoverable data loss.

This PR introduces pre-checks and warnings as a workaround to mitigate such scenarios -- Add to the pre-check logic for table rebalancing when "pauseless ingestion" is enabled yet the rebalance parameters have downtime=trueorminAvailableReplicas=0`, adding additional safety checks and warnings to prevent potential data loss.

Key Changes

  • Enhance Pre-Check Logic:

    • Add warnings in the pre-check item "rebalanceConfigOptions" if:
      • Replication is 1 for pauseless tables (inevitably needs downtime, which may cause risk of data loss).
      • Downtime or minAvailableReplicas=0 for pauseless tables.
  • Testing:

    • Add/extend tests in TableRebalancerClusterStatelessTest to cover new warning scenarios and validate correct pre-check status/messages for pauseless tables.

Tests

Case 1: Pauseless table with RF=1 -> RF=1, rebalanced from 2 servers to 1 server, downtime=false, minAvailableReplica=-1

image

Case 2: Pauseless table with RF=1 -> RF=2, rebalanced from 1 servers to 2 server, downtime=true

image

Case 3: Pauseless table with RF=1 -> RF=2, rebalanced from 1 servers to 2 server, minAvailableReplica=-2

image

Case 4: Pauseless table with RF=1 -> RF=2, rebalanced from 1 servers to 2 server, minAvailableReplica=-1

image

}
}

if (PauselessConsumptionUtils.isPauselessEnabled(tableConfig)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: let's add a TODO here to revisit if this pre-check should be removed once improvements are made to rebalance to handle this scenario better, so that we don't forget to address this

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

Copy link
Contributor

@somandal somandal left a comment

Choose a reason for hiding this comment

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

lgtm! thanks for the quick turnaround on this!

@codecov-commenter
Copy link

codecov-commenter commented May 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.43%. Comparing base (1a476de) to head (3c4d3d3).
Report is 174 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #15953      +/-   ##
============================================
+ Coverage     62.90%   63.43%   +0.52%     
+ Complexity     1386     1353      -33     
============================================
  Files          2867     2895      +28     
  Lines        163354   166337    +2983     
  Branches      24952    25439     +487     
============================================
+ Hits         102755   105510    +2755     
+ Misses        52847    52833      -14     
- Partials       7752     7994     +242     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.41% <100.00%> (+0.54%) ⬆️
java-21 63.35% <100.00%> (+0.53%) ⬆️
skip-bytebuffers-false ?
skip-bytebuffers-true ?
temurin 63.43% <100.00%> (+0.52%) ⬆️
unittests 63.42% <100.00%> (+0.52%) ⬆️
unittests1 56.53% <ø> (+0.71%) ⬆️
unittests2 33.40% <100.00%> (-0.17%) ⬇️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@somandal somandal merged commit 1abc8f2 into apache:master May 30, 2025
18 checks passed
songwdfu pushed a commit to songwdfu/pinot that referenced this pull request Jun 3, 2025
…es (apache#15953)

* add precheck for pauseless table with downtime/minAvailableReplica=0

* add test for pauseless pre-check

* lint: style

* add comment and todo
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