feat(mongodb): adapt shard lifecycle to syncer APIs - #3282
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## release-1.1 #3282 +/- ##
===========================================
Coverage 0.00% 0.00%
===========================================
Files 76 77 +1
Lines 9886 9924 +38
===========================================
- Misses 9886 9924 +38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
weicao
left a comment
There was a problem hiding this comment.
I found four release-blocking issues:
-
Default Syncer image lacks the invoked shard commands. The chart still renders
apecloud/syncer:0.7.7, whosesyncerctlexposes neitheradd-shardnorremove-shard, while this change invokes both. Default shard post-provision and shard removal therefore fail before the new lifecycle behavior can run, leaving creation and scale workflows stuck. -
Released KubeBlocks does not enforce the declared polling budgets. The new flow relies on
maxRetriesandretryInterval, but the supported released Core baselines serialize and ignoreActionRequest.RetryPolicy. A Running or persistently failing Syncer operation is governed by controller reconciliation rather than these bounds and can churn or block creation and scale workflows indefinitely. -
Shard removal no longer restores an initially disabled balancer. The declared Syncer implementation unconditionally runs
balancerStartand never restores the prior state, whereas the deleted script did. Automatic migrations and MongoDB 7+ AutoMerger can remain enabled after removal and interfere with administrator-selected maintenance or manual-backup windows. -
The destructive cross-repository workflow lacks exact-head runtime evidence. The available checks do not demonstrate a live 1→2→1 shard cycle with data movement, database-primary movement, primary changes, Syncer restart/resume, or the materially different supported MongoDB versions. Scale-in can therefore merge without evidence that it preserves data and resumes safely on the real runtime path.
53e6726 to
fe994e3
Compare
Summary
add-shardAPI from the MongoDB shardpostProvisionlifecycleremove-shardAPI from the shardingshardRemovelifecyclesyncerctltimeoutSeconds: -1because draining can exceed KubeBlocks' default action timeoutKubeBlocks 1.1.0-beta.8 action retries use coarse/exponential backoff and terminated a real remove operation before Syncer reached
Succeeded; keeping the bounded polling loop inside the lifecycle action avoids that mismatch while preserving Syncer as the sole shard-operation owner.Dependency
Requires the Syncer shard operation implementation from
apecloud/syncerbranchfeature/mongodb-shard-operations(commit0d4de47or a descendant) in the configured Syncer image.Validation
shellspec ... shard_manage_spec.sh: 3 examples, 0 failureshelm lint addons/mongodbhelm template mongodb addons/mongodb --namespace kb-systembash -n addons/mongodb/scripts/mongodb-shard-manage.shgit diff --check1 -> 2 -> 10d4de47, companion Syncer-test8f1a3e7Companion test: https://github.com/apecloud/syncer-test/pull/3