|
Ran
|
Jobs
1
|
Files
518
|
Run time
2min
|
Badge
README BADGES
|
push
github
memtx: handle OOM on statement rollback Currently during statement rollback we either assume that rollback does not fail or panic on failure. Unfortunately rollback can fail due to OOM because of opened read view and reservations done for rollback. Let's handle this situation similar to transaction rollback in [1]. Let's set new transaction flag `TXN_STMT_ROLLBACK` before doing statement rollback and check it when we need to allocate memory in memtx arena. If flag is set and memory exhausted then allocate memory outside the arena. Handle is added to HASH and TREE indexes. RTREE data structure does not handle OOM's yet, we have heuristic reservation in RTREE index. BITSET partially allocates memory using `realloc`. To test the situation we can add something like `ERRINJ_INDEX_ALLOC_COUNTDOWN` injection to imitate memory exhausting during statement execution. But tests with such injection are fragile - they depend specific pattern of memory allocation in index data structure. Instead let's build injection around index data structure calls using introduced `INDEX_OOM_ERRINJ`. This way we may have injections that are not possible but it does not hurt. It is not a problem that we check we handle impossible failures too in tests. [1] commit 32ea713af0a4 ("box: fix crash on rollback on memtx memory OOM and massive index change") Closes #11171 NO_DOC=bugfix (cherry picked from commit bea61aed3)
70419 of 124085 branches covered (56.75%)
128 of 141 new or added lines in 5 files covered. (90.78%)
16 existing lines in 8 files now uncovered.103590 of 118344 relevant lines covered (87.53%)
2880190.26 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 2 |
95.63 |
0.88% | src/box/memtx_tree.cc |
| 11 |
91.81 |
-2.7% | src/box/memtx_hash.cc |
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
95.05 |
-0.31% | src/box/raft.c |
| 1 |
84.26 |
0.0% | src/box/xlog.c |
| 1 |
96.55 |
-1.15% | src/lib/core/histogram.c |
| 2 |
95.84 |
-0.11% | src/box/iproto.cc |
| 2 |
90.98 |
-0.18% | src/box/memtx_engine.cc |
| 2 |
95.96 |
-0.37% | src/box/relay.cc |
| 3 |
92.45 |
-0.09% | src/box/vinyl.c |
| 4 |
94.23 |
-0.8% | src/box/xrow_update_field.c |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 14668455152.1 | 518 |
87.53 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|