-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
multishard_mutation_query: add tablets support #16802
multishard_mutation_query: add tablets support #16802
Conversation
Could we change those code paths not to use multishard_mutation_query? It will make it easier to get rid of it eventually. We don't have to do it all at once (and this would be a first step). |
Missing: tests. What gets unbroken here? SELECT mutation_fragments? |
If it's just mutation_fragments, perhaps we can short-circuit the whole thing and move the code there. It's bad since it's replica code in the coordinator, but it lets us isolate multishard_mutation_query for eventual removal. It's okay for SELECT mutation_fragments to not cross tablet boundaries. |
But: cqlsh paging should be improved. If it received a page smaller than the terminal size, it should fetch the next page. If it receives a page larger than the page size, it should ask the user to confirm and not dump the whole page. @fruch |
I'm not sure how pagination works in cqlsh, but having empty pages is quite common, and we handle it across the different test environments, so having more cases that would generate empty pages would probably go unnoticed. |
🟢 CI State: SUCCESS✅ - Build Build Details:
|
Yes, they break with tablets. With this PR, they don't anymore. |
I considered it, but then realized we have new users for this code in mind, see #16478. |
f6b65e3
to
d83cd80
Compare
New in v2:
|
🟢 CI State: SUCCESS✅ - Build Build Details:
|
d83cd80
to
1ea5678
Compare
New in v3:
|
@nyh please review the last few patches, I demonstrate how to parameterize tests to run with both vnodes and tablets. |
Wouldn't LOCAL_ONLY run through storage_proxy? mutation_fragments has an excuse to bypass storage_proxy since it reads mutation fragments, not row results, but LOCAL_ONLY should go through storage_proxy. |
🟢 CI State: SUCCESS✅ - Build Build Details:
|
Going through storage proxy would involve doing a range pre-processing in the CQL layer, to make sure to only pass ranges that the local node owns, to storage proxy. This would be awkward to do because the storage-proxy query API accepts a single range at a time, so the CQL layer would end up stiching together partial results and doing limit accounting. |
ping, let's finalize this PR and get it merged |
9647966
to
fc8b75d
Compare
New in v4:
|
🟢 CI State: SUCCESS✅ - Build Build Details:
|
fc8b75d
to
944096a
Compare
v5:
|
🟢 CI State: SUCCESS✅ - Build Build Details:
|
944096a
to
1dee6b7
Compare
v6:
|
other_is_before is awkward but at least it doesn't generate the wrong impression, so let's go with that. |
🔴 CI State: FAILURE✅ - Build Failed Tests (2/26087):
Build Details:
|
The current point variant cannot take inclusiveness into account, when said point comes from another interval bound. This method had no tests at all, so add tests covering both overloads.
…inclusive Consider the inclusiveness of the token-range's start and end bounds and copy the flag to the output bounds, instead of assuming they are always inclusive.
Given a list of partition-ranges, yields the intersection of this range-list, with that of that tablet-ranges, for tablets located on the given host. This will be used in multishard_mutation_query.cc, to obtain the ranges to read from the local node: given the read ranges, obtain the ranges belonging to tablets who have replicas on the local node.
Merging two disjoint reconcilable_result instances.
…tr<result>> Makes future patching easier.
…r factory This param was used by the query-result builder, to set the last-position on end-of-stream. Instead, do this via a new ResultBuilder method, maybe_set_last_position(), which is called from read_page(), which has access to the compaction-state. With this, the ResultBuilder can be created without a compaction-state at hand. This will be important in the next patch.
When reading a list of ranges with tablets, we don't need a multishard reader. Instead, we intersect the range list with the local nodes tablet ranges, then read each range from the respective shard. The individual ranges are read sequentially, with database::query[_mutations](), merging the results into a single instance. This makes the code simple. For tablets, multishard_mutation_query.cc is no longer on the hot paths, range scans on tables with tablets fork off to a different code-path in the coordinator. The only code using multishard_mutation_query.cc are forced, replica-local scans, like those used by SELECT * FROM MUTATION_FRAGMENTS(). These are mainly used for diagnostics and tests, so we optimize for simplicity, not performance.
…with_tablets The underlying functionality was fixed, the tests should now pass with tablets.
…tests To run with both vnodes and tablets. For this functionality, both replication methods should be covered with tests, because it uses different ways to produce partition lists, depending on the replication method. Also add scylla_only to those tests that were missing this fixture before. All tests in this suite are scylla-only and with the parameterization, this is even more apparent.
All tests that used it are fixed, and we should not add any new tests failing with tablets from now on, so remove.
1dee6b7
to
ca58590
Compare
🟢 CI State: SUCCESS✅ - Build Build Details:
|
When reading a list of ranges with tablets, we don't need a multishard reader. Instead, we intersect the range list with the local nodes tablet ranges, then read each range from the respective shard.
The individual ranges are read sequentially, with database::query_mutations, merging the results into a single
instance. This makes the code simple. For tablets multishard_mutation_query.cc is no longer on the hot paths, range scans
on tables with tablets fork off to a different code-path in the coordinator. The only code using multishard_mutation_query.cc are forced, replica-local scans, like those used by SELECT * FROM MUTATION_FRAGMENTS(). These are mainly used for diagnostics and tests, so we optimize for simplicity, not performance.
Fixes: #16484