Ran
|
Files
479
|
Run time
19s
|
Badge
Embed ▾
README BADGES
|
push
github
vinyl: handle error loading statement from disk during key lookup `vy_page_stmt()` may fail (return NULL) if: - the statement is corrupted; - memory allocation for the statement fails; - the statement size exceeds `box.cfg.vinyl_max_tuple_size`. If this happens `vy_page_find_key()` won't return an error. Instead, it'll either point the caller to a wrong statement or claim that there's no statement matching the key in this page. This may result in invalid index selection results and, later on, a crash caused by inconsistencies in the tuple cache. The issue was introduced by commit ac8ce0233a00 ("vinyl: factor out function to lookup key in page"). All of the three cases are actually very unlikely to happen in production: - If a statement stored in a run file is corrupted, we'll probably fail to load the whole page due to failed checksums and never even get to `vy_page_stmt()`. - Statements are allocated with `malloc()`, which doesn't normally fail (instead the whole process would be terminated by OOM) . - Users don't tend to lower the tuple size limit after restart. Still, let's fix the issue by implementing proper error handling for `vy_page_find_key()`. Closes #10512 NO_DOC=bug fix (cherry picked from commit 9dbaa6a9b)
63008 of 114253 branches covered (55.15%)
93900 of 109306 relevant lines covered (85.91%)
2455082.57 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
---|