|
Ran
|
Jobs
1
|
Files
519
|
Run time
3min
|
Badge
README BADGES
|
push
github
box: forbid concurrent invocation of `box_raft_try_promote` Currently, we allow concurrent invocation of `box_raft_try_promote`, since we either disable the `is_in_promote` guard in `box_promote` or omit it in `box_cfg_xc`, while `box_raft_try_promote` yields to write the raft state. This leads to a race over the `diag` of the fiber executing the `box_raft_try_promote_f` trigger, and can lead to more bugs. Let's forbid concurrent execution of `box_raft_try_promote` by enabling the `is_in_promote` guard while `box_raft_try_promote` is called. One potential caveat is the concurrent execution of `box_promote_qsync` which is also guarded by the `is_in_promote`. However, it is executed in the raft worker fiber and can be retried until `box_raft_try_promote` execution finishes. To be on the safer side, let's: 1. Call `raft_restore` before setting the fiber's `diag` to prevent any potential tampering with it from `raft->on_update` triggers. 2. Set `is_box_configured` right before calling `box_raft_try_promote` to maintain the invariant that it is always called by `box.cfg` first. Also move `box_broadcast_ballot` for consistency. The `raft_leader_promote` test from the gh-6033 test group should now test that a concurrent promote fails rather than succeeds. Closes #11703 Closes #11708 NO_DOC=<bugfix> (cherry picked from commit b59284539)
69156 of 116573 branches covered (59.32%)
103991 of 118746 relevant lines covered (87.57%)
1385150.49 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
92.55 |
0.09% | src/box/vinyl.c |
| 1 |
95.74 |
0.0% | src/box/vy_range.c |
| 1 |
96.55 |
-1.15% | src/lib/core/histogram.c |
| 1 |
94.59 |
0.96% | src/lib/swim/swim_io.c |
| 1 |
97.41 |
-0.85% | src/lib/vclock/vclock.c |
| 2 |
94.25 |
-0.29% | src/box/memtx_space.c |
| 2 |
93.14 |
-0.18% | src/lib/core/fiber.c |
| 4 |
90.76 |
-0.09% | src/box/box.cc |
| 4 |
84.26 |
-0.26% | src/box/xlog.c |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 19630355198.1 | 519 |
87.57 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|