fix: Publisher-mode synchronization option for failover scenario#3222
fix: Publisher-mode synchronization option for failover scenario#3222
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @alpe's task in 3m 5s —— View job Code Review
SummaryThe PR correctly identifies and fixes a race/deadlock in the HA failover path: when a fresh raft leader starts with an empty store, A few items worth addressing before merge: Issues1. Mutex held during
That said, the current approach is correct and simple. If startup is expected to be fast in practice, this is acceptable as-is, but worth a comment acknowledging the design choice. 2. func (syncerStatus *SyncerStatus) stopIfStarted(stopFn func() error) error {
...
if err := stopFn(); err != nil {
return err // ← started is NOT cleared
}
syncerStatus.started = false
return nil
}If 3. go func() {
defer wg.Done()
_, err := status.startOnce(func() error { ... })
require.NoError(t, err) // ← calls t.FailNow() from non-test goroutine
}()
4. Missing error case in The test has a 5. Subscriber started before syncer in
Observations (non-blocking)
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #3222 +/- ##
==========================================
- Coverage 61.43% 61.41% -0.02%
==========================================
Files 120 120
Lines 12504 12563 +59
==========================================
+ Hits 7682 7716 +34
- Misses 3960 3977 +17
- Partials 862 870 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Overview
E2E HA tests fail sometimes on a race when the leader is waiting for p2p sync complete on a fresh start.