feat: support non-blocking shard actions - #10725
Conversation
|
Auto Cherry-pick Instructions CLA Recheck Instructions |
|
CI 巡检分型,绑定 current exact
本次只补 current-head 证据,未 rerun/cancel。 |
weicao
left a comment
There was a problem hiding this comment.
The up-to-date fast path ignores the persisted non-blocking shard-action annotations. After target selection is saved and the Component and Cluster generations catch up, delayed and watch-driven reconciles exit before invoking or polling shardAdd, leaving the shard transition pending while Cluster status reports the desired generation as observed.
Reversing scale-out while a non-blocking shardAdd is running on an AllShards target that survives the reversal makes handleShardRemove return without polling or cancelling the detached add, and the source shard is then deleted. The obsolete action can continue changing membership or data on surviving shards after its source is removed, leaving the shard topology inconsistent.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #10725 +/- ##
==========================================
+ Coverage 64.56% 64.69% +0.13%
==========================================
Files 521 507 -14
Lines 63343 63716 +373
==========================================
+ Hits 40897 41223 +326
- Misses 18804 18820 +16
- Partials 3642 3673 +31
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Exact-head dependency recheck at The new Therefore Kubernetes can reject the first target-persistence update before any shard action is dispatched. Please move/shard/bound this state and add an exact 2,048-by-3 regression. This head change invalidates prior-head runtime evidence but does not alter the addon source fix in kubeblocks-addons#3285. |
What changed
Action.nonBlockingto explicitly supported API fields and whitelistshardAdd/shardRemove(Pod, Action)while allowing disjoint requests to progress concurrentlyWhy
Shard add/remove actions can run for minutes while moving data or rebalancing a cluster. The existing blocking controller path cannot reliably handle those actions within the synchronous call limit. This change lets the two sharding actions opt into the non-blocking Action framework introduced by #10715 without enabling non-blocking mode for unrelated lifecycle actions.
User impact
Addon authors may set
nonBlocking: trueonShardingDefinition.spec.lifecycleActions.shardAddorshardRemove. Existing definitions remain blocking by default. This PR does not change any addon configuration.Validation
make generatemake manifestsmake docgo test ./controllers/apps -count=1with envtest assetsgo test ./controllers/apps/cluster -count=1with envtest assetsgo test ./pkg/controller/lifecycle -count=1with envtest assetsgo test ./pkg/kbagent/... -count=1go vet ./controllers/apps/cluster ./controllers/apps ./pkg/controller/lifecyclemake golangci-lint(0 issues)