-
Notifications
You must be signed in to change notification settings - Fork 21
CNDB-16203: Make the counters in QueryContext plain longs #2153
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
Conversation
Checklist before you submit for review
|
pkolaczk
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The QueryContext changes looks good, but I suggest removing the not-used options instead of deprecating and optionally adding thread safety checks.
|
|
||
| // Enables parallel index read. | ||
| @Deprecated // unused since BM25 removed parallel index read | ||
| USE_PARALLEL_INDEX_READ("cassandra.index_read.parallel", "true"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Deprecated should be used to mark things that technically still work but are going to be removed soon so to give the callers/users some time to stop using them. But it looks like we don't use this option anymore at all, and additionally, it doesn't work (flipping it doesn't change anything). I suggest removing it totally, because otherwise it only adds confusion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a bit of a different experience.
We add the @Deprecated so anyone who thinks they are using it (it doesn't work anymore) can take the time to remove it and not just get broken straight.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is no difference than a cassandra.yaml property (be careful with backward compatibility, breaking changes, etc). I'd say deprecate here, remove in main-5.0, to be on the safe side. WDYT? We should also document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ekaterinadimitrova2 that was my initial reasoning leading to deprecate rather than remove the properties.
However, it seems that, differently to yaml properties, unknown system properties are not rejected. So startup won't fail if we remove the properties, it will simply be no-op. We don't have any entrypoints to dynamically change these property either.
If we leave them as deprecated, it doesn't seem that there is anything to warn about the usage of a deprecated system property. So starting with our without the property will be no-op too.
Normally I would agree that removing or even silently making a property no-op is not ideal. But in our case this was already no-op before, since the introduction of BM25. I think we are not really changing anything here, just finishing the cleanup of dead code left by BM25.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, it seems that, differently to yaml properties, unknown system properties are not rejected.
Yes, they are not. But if we warn - then people will know to remove them/clean/etc. Otherwise it will be weird dead code (anyone using -D in their scripts, etc) for anyone who was using them with wrong expectations? (it won't break as they are not used internally)
But in our case this was already no-op before, since the introduction of BM25.
That is a good point that most people should have realized it up to now... Let's just put a note then and clean it. No better cleaning than removing "stuff" :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a note in the the issue's release notes. It says that they were no-op, and now they are still no-op too, which makes me think we might don't need the note at all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which makes me think we might don't need the note at all.
No-op on our end, but I think the note is ok - it signals people they can do some cleaning on their end if they were using the -D flag and reduce confusion and amount of flags used in their clusters.
| @Deprecated // unused since BM25 removed parallel index read | ||
| USE_PARALLEL_INDEX_READ("cassandra.index_read.parallel", "true"), | ||
| @Deprecated // unused since BM25 removed parallel index read | ||
| PARALLEL_INDEX_READ_NUM_THREADS("cassandra.index_read.parallel_thread_num"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
0daedcc to
bc700c4
Compare
ekaterinadimitrova2
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "new" test failures are timeouts we see in CI which shouldn't be related to what we do here. Maybe run the tests locally one more time before commit to ensure we are not missing anything as they are in the SAI area - just in case.
|
|
||
| // Enables parallel index read. | ||
| USE_PARALLEL_INDEX_READ("cassandra.index_read.parallel", "true"), | ||
| PARALLEL_INDEX_READ_NUM_THREADS("cassandra.index_read.parallel_thread_num"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: You may want to update the PR description to say they are removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I have updated the description of both PRs.
|
|
||
| // Enables parallel index read. | ||
| @Deprecated // unused since BM25 removed parallel index read | ||
| USE_PARALLEL_INDEX_READ("cassandra.index_read.parallel", "true"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which makes me think we might don't need the note at all.
No-op on our end, but I think the note is ok - it signals people they can do some cleaning on their end if they were using the -D flag and reduce confusion and amount of flags used in their clusters.
We don't need all the counters in QueryContext to be LongAdder, since they are only accessed by the query's thread. They used to be plain longs until VECTOR-SEARCH-29 parallelized vector searches, making them accessed by multiple threads. However, that parallelization was removed by the BM25 patch. The system properties USE_PARALLEL_INDEX_READ and PARALLEL_INDEX_READ_NUM_THREADS are marked as deprecated, since they are unused since the introduction of BM25.
Metrics are generally read from the context snapshot
bc700c4 to
adfda82
Compare
|
❌ Build ds-cassandra-pr-gate/PR-2153 rejected by Butler2 regressions found Found 2 new test failures
Found 2 known test failures |



What is the issue
We don't need all the counters in
QueryContextto beLongAdder, since they are only accessed by the query's thread.They used to be plain longs until VECTOR-SEARCH-29 parallelized vector searches, making them accessed by multiple threads. However, that parallelization was removed by the BM25 patch
The system properties
USE_PARALLEL_INDEX_READandPARALLEL_INDEX_READ_NUM_THREADSare unused since BM25 removed parallel search.What does this PR fix and why was it fixed
This PR makes the counters in
QueryContextplainlongs, without any concurrency control within the class.The system properties
USE_PARALLEL_INDEX_READandPARALLEL_INDEX_READ_NUM_THREADSare removed, since they were no-op since the introduction of BM25. Since we don't reject unknown system properties, they will remain no-op.