Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNDB-12342 Fix query view builder inifinite loop #1516

Open
wants to merge 2 commits into
base: cndb-main-release-20250109
Choose a base branch
from

Conversation

pkolaczk
Copy link

michaeljmarshall and others added 2 commits January 17, 2025 14:56
…)" (#1510)

This commit failed several CNDB tests.

This reverts commit 6a1e981.
Instead of matching sstables and memtables to indexes we know,
go in the opposite direction: find a corresponding index for each
sstable and memtable. That limits the necessity of retrying.
It also has an additional benefit of detecting
reliably the situation when the indexes are suddenly
dropped during the query or when the indexes are permanently
missing for any other reason - we can signal those situations
immediately with an exception instead of looping until the query
timeout.

Retrying is only needed whenever an index view update happens
(e.g. due to a flush or compaction) and the index view is temporarily
out of sync from the C* View.
We now detect this situation more accurately than before - the
SAI View class now keeps track not only of the indexes, but also of all
the sstables regardless of their index status. This way we can quickly
check if current index view is up to date by consulting its sstable
list. See View#containsSSTableIndex and View#isAwareOfSSTable.

For memtables we don't have a similar mechanism of detecting
in-flight memtable index set update yet, but
fortunately memtables are created empty, so when a new memtable
appears, and we miss it, we don't introduce a correctness problem.
We just need to be a bit more careful on memtable / memtable index
removal -  we need to make sure we capture the sstable and sstable
indexes flushed from the memtable, so if we don't find the memtable
index, we retry once.
@pkolaczk pkolaczk changed the title cndb 12342 fix query view builder inifinite loop release 20250109 CNDB-12342 Fix query view builder inifinite loop Jan 17, 2025
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