Skip to content

api: fix pointsCache stale reads and table multi-LOD column corruption - #2280

Merged
Rustamchuk merged 1 commit into
VKCOM:masterfrom
razmser:cache-fix
Jul 8, 2026
Merged

Rustamchuk merged 1 commit into
VKCOM:masterfrom
razmser:cache-fix

Conversation

@razmser

@razmser razmser commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

pointsCache stored a single loadedAtNano per cache entry, shared across all time ranges of the same query. Loading one range refreshed that timestamp, so an already-invalidated range could be revalidated and served stale. Track loadedAtNano per time range instead.

getTableFromLODs ran the "pad missing rows with NaN" step inside the per-LOD loop. Since each (time, tags) row belongs to exactly one LOD, a row from an earlier LOD got an extra NaN appended for every subsequent LOD, misaligning Data column counts. Pad once per handler-what, after all LODs.

Both paths get a regression test.

pointsCache stored a single loadedAtNano per cache entry, shared across all
time ranges of the same query. Loading one range refreshed that timestamp, so
an already-invalidated range could be revalidated and served stale. Track
loadedAtNano per time range instead.

getTableFromLODs ran the "pad missing rows with NaN" step inside the per-LOD
loop. Since each (time, tags) row belongs to exactly one LOD, a row from an
earlier LOD got an extra NaN appended for every subsequent LOD, misaligning
Data column counts. Pad once per handler-what, after all LODs.

Both paths get a regression test.
@razmser
razmser requested a review from a team as a code owner July 8, 2026 10:41
@Rustamchuk
Rustamchuk merged commit c751674 into VKCOM:master Jul 8, 2026
2 checks passed
@razmser
razmser deleted the cache-fix branch July 8, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants