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

SELECT FROM MUTATION FRAGMENTS doesn't work with tablets #16484

Closed
nyh opened this issue Dec 20, 2023 · 2 comments · Fixed by #16802
Closed

SELECT FROM MUTATION FRAGMENTS doesn't work with tablets #16484

nyh opened this issue Dec 20, 2023 · 2 comments · Fixed by #16802
Assignees
Milestone

Comments

@nyh
Copy link
Contributor

nyh commented Dec 20, 2023

When a keyspace has tablets enabled, running SELECT * FROM MUTATION_FRAGMENTS(tab) results in an on-internal-error like:

multishard reader cannot be used on tables with non-static sharding: cql_test_1703071950171.cql_test_1703071950180

The interesting part of the backtrace is

seastar::on_internal_error(seastar::logger&, std::basic_string_view<char, std::char_traits<char> >) at ??:?
read_context::read_context(seastar::sharded<replica::database>&, seastar::lw_shared_ptr<schema const>, seastar::shared_ptr<locator::effective_replication_map const>, query::read_command const&, std::vector<nonwrapping_interval<dht::ring_position>, std::allocator<nonwrapping_interval<dht::ring_position> > > const&, tracing::trace_state_ptr, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >) at multishard_mutation_query.cc:?
seastar::shared_ptr_count_for<read_context>::shared_ptr_count_for<seastar::sharded<replica::database>&, seastar::lw_shared_ptr<schema const>&, seastar::shared_ptr<locator::effective_replication_map const>&, query::read_command const&, std::vector<nonwrapping_interval<dht::ring_position>, std::allocator<nonwrapping_interval<dht::ring_position> > > const&, tracing::trace_state_ptr&, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >&>(seastar::sharded<replica::database>&, seastar::lw_shared_ptr<schema const>&, seastar::shared_ptr<locator::effective_replication_map const>&, query::read_command const&, std::vector<nonwrapping_interval<dht::ring_position>, std::allocator<nonwrapping_interval<dht::ring_position> > > const&, tracing::trace_state_ptr&, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >&) at multishard_mutation_query.cc:?
seastar::future<(anonymous namespace)::mutation_query_result_builder::result_type> do_query<(anonymous namespace)::mutation_query_result_builder>(seastar::sharded<replica::database>&, seastar::lw_shared_ptr<schema const>, query::read_command const&, std::vector<nonwrapping_interval<dht::ring_position>, std::allocator<nonwrapping_interval<dht::ring_position> > > const&, tracing::trace_state_ptr, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, seastar::noncopyable_function<(anonymous namespace)::mutation_query_result_builder (compact_mutation_state<(compact_for_sstables)0> const&)>) at multishard_mutation_query.cc:?
seastar::future<std::tuple<seastar::foreign_ptr<seastar::lw_shared_ptr<(anonymous namespace)::mutation_query_result_builder::result_type> >, cache_temperature> > do_query_on_all_shards<(anonymous namespace)::mutation_query_result_builder>(seastar::sharded<replica::database>&, seastar::lw_shared_ptr<schema const>, query::read_command const&, std::vector<nonwrapping_interval<dht::ring_position>, std::allocator<nonwrapping_interval<dht::ring_position> > > const&, tracing::trace_state_ptr, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >, std::function<(anonymous namespace)::mutation_query_result_builder (query::result_memory_accounter&&, compact_mutation_state<(compact_for_sstables)0> const&)>) at multishard_mutation_query.cc:?
query_mutations_on_all_shards(seastar::sharded<replica::database>&, seastar::lw_shared_ptr<schema const>, query::read_command const&, std::vector<nonwrapping_interval<dht::ring_position>, std::allocator<nonwrapping_interval<dht::ring_position> > > const&, tracing::trace_state_ptr, std::chrono::time_point<seastar::lowres_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > >) at multishard_mutation_query.cc:?
replica::mutation_dump::(anonymous namespace)::multi_range_partition_generator::read_next_page() at mutation_dump.cc:?

Can be reproduced by

  • test/cql-pytest/run test_select_from_mutation_fragments.py::test_smoke
  • test/cql-pytest/run test_select_from_mutation_fragments.py::test_many_partition_scan
  • test/cql-pytest/run test_select_from_mutation_fragments.py::test_metadata_and_value
  • test/cql-pytest/run test_select_from_mutation_fragments.py::test_many_partitions

(after hacking tablets to be enabled by default, see #16473).

CC @tgrabiec @denesb

@denesb
Copy link
Contributor

denesb commented Dec 20, 2023

multishard_mutation_query.cc doesn't work with tablets at all. This is used to generate the partition-list for range scans. I will have to come up with a tablet-specific way to do this.

@denesb
Copy link
Contributor

denesb commented Feb 21, 2024

No vulnerable versions, no backport required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants