|
Ran
|
Jobs
1
|
Files
479
|
Run time
62min
|
Badge
README BADGES
|
push
github
vinyl: fix space truncation being aborted by yield under load Under the hood, `space:truncate()` calls `space_vtab::build_index` to notify the engine about index recreation, see `TruncateIndex::prepare`. `space_vtab::build_index` isn't supposed to yield in this case because the space is empty (note that `TruncateIndex::prepare` passes the new space to the callback). However, there's a bug in vinyl that makes this callback yield for no good reason, aborting `space:truncate()` with `ER_TRANSACTION_YIELD`. The problem lies in `vy_tx_manager_abort_writers_for_ddl()`, which is called by `vinyl_space_build_index()` to abort all transactions that write to the target space. If a transaction can't be aborted because it has reached WAL, the function sets the `need_wal_sync` flag which indicates the caller that they should call `wal_sync()` to flush all unconfirmed transactions. In case of a space truncation, the function should do nothing because there can't possibly be a transaction writing to the new space, but actually it sets `need_wal_sync` if there's any transaction waiting for WAL. This mistake doesn't lead to any problems during an actual index build, but in case of a space truncation it results in the transaction being aborted by a fiber yield. Let's fix this problem by setting the `need_wal_sync` flag only if there are transactions that actually write to the target space. Closes #11249 NO_DOC=bug fix (cherry picked from commit b145c0c89)
63436 of 114770 branches covered (55.27%)
6 of 6 new or added lines in 1 file covered. (100.0%)
21 existing lines in 9 files now uncovered.94403 of 109663 relevant lines covered (86.08%)
3290558.92 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
94.25 |
-0.21% | src/box/vy_read_iterator.c |
| 1 |
96.55 |
-1.15% | src/histogram.c |
| 1 |
98.23 |
-0.06% | src/lib/salad/bps_tree.h |
| 2 |
92.19 |
0.0% | src/box/vinyl.c |
| 2 |
95.18 |
-0.42% | src/lua/fiber.c |
| 3 |
90.01 |
-0.23% | src/box/applier.cc |
| 3 |
93.2 |
-1.02% | src/box/gc.c |
| 3 |
93.09 |
-1.6% | src/box/vy_range.c |
| 5 |
86.39 |
-0.34% | src/box/vy_run.c |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 13837425551.1 | 839 |
85.97 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|