Commit 1cf746e
committed
fix(uraft): Defer promotion request during demotion
Previously, if a promotion was requested while a demotion was still in
progress, the request was ignored. This could leave the node stuck in
a follower state even when a promotion was desired.
This commit adds a `force_promote_` flag to defer the promotion until
the current demotion completes. Once demotion finishes, the controller
automatically triggers a forced promotion and logs the transition.
This ensures consistent role transitions and prevents promotion loss
during overlapping commands.
Signed-off-by: Crash <[email protected]>1 parent 2659b5b commit 1cf746e
2 files changed
+12
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | | - | |
74 | | - | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
160 | 162 | | |
161 | 163 | | |
162 | 164 | | |
| 165 | + | |
163 | 166 | | |
164 | 167 | | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
165 | 174 | | |
166 | 175 | | |
167 | 176 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
0 commit comments