Ran
|
Jobs
1
|
Files
514
|
Run time
1min
|
Badge
Embed ▾
README BADGES
|
push
github
vinyl: fix handling of duplicate multikey entries in transaction write set A multikey index stores a tuple once per each entry of the indexed array field, excluding duplicates. For example, if the array field equals {1, 3, 2, 3}, the tuple will be stored three times. Currently, when a tuple with duplicate multikey entries is inserted into a transaction write set, duplicates are overwritten as if they belonged to different statements. Actually, this is pointless: we could just as well skip them without trying to add to the write set. Besides, this may break the assumptions taken by various optimizations, resulting in anomalies. Consider the following example: ```lua local s = box.schema.space.create('test', {engine = 'vinyl'}) s:create_index('primary') s:create_index('secondary', {parts = {{'[2][*]', 'unsigned'}}}) s:replace({1, {10, 10}}) s:update({1}, {{'=', 2, {10}}}) ``` It will insert the following entries to the transaction write set of the secondary index: 1. REPLACE {10, 1} [overwritten by no.2] 2. REPLACE {10, 1} [overwritten by no.3] 3. DELETE {10, 1} [turned into no-op as REPLACE + DELETE] 4. DELETE {10, 1} [overwritten by no.5] 5. REPLACE {10, 1} [turned into no-op as DELETE + REPLACE] (1-2 correspond to `replace()` and 3-5 to `delete()`) As a result, tuple {1, {10}} will be lost forever. Let's fix this issue by silently skipping duplicate multikey entries added to a transaction write set. After the fix, the example above will produce the following write set entries: 1. REPLACE{10, 1} [overwritten by no.2] 2. DELETE{10, 1} [turned into no-op as REPLACE + DELETE] 3. REPLACE{10, 1} [committed] (1 corresponds to `replace()` and 2-3 to `delete()`) Closes #10869 Closes #10870 NO_DOC=bug fix (cherry picked from commit 1869dce15)
68558 of 121788 branches covered (56.29%)
6 of 6 new or added lines in 1 file covered. (100.0%)
29 existing lines in 15 files now uncovered.101183 of 115928 relevant lines covered (87.28%)
2834469.36 hits per line
Lines | Coverage | ∆ | File |
---|---|---|---|
1 |
65.97 |
1.27% | src/lib/core/fio.c |
1 |
90.38 |
-1.92% | src/lib/core/trigger.cc |
1 |
87.6 |
-0.07% | src/box/vy_run.c |
1 |
22.68 |
0.04% | src/lib/uri/uri_parser.c |
1 |
92.07 |
0.05% | src/box/vinyl.c |
1 |
94.58 |
-0.11% | src/box/vy_tx.c |
2 |
88.68 |
-0.11% | src/box/xrow.c |
2 |
95.01 |
-0.13% | src/box/replication.cc |
2 |
93.84 |
0.0% | src/box/xrow_update_field.c |
2 |
84.89 |
-0.72% | src/lib/core/coio.c |
2 |
95.69 |
-0.22% | src/lib/msgpuck/msgpuck.h |
2 |
92.92 |
0.08% | src/lib/core/fiber.c |
3 |
90.55 |
-0.23% | src/box/applier.cc |
4 |
81.82 |
-12.12% | src/lua/minifio.c |
4 |
90.93 |
-0.41% | src/box/vy_scheduler.c |
ID | Job ID | Ran | Files | Coverage | |
---|---|---|---|---|---|
1 | 12137822716.1 | 514 |
87.28 |
GitHub Action Run |
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|