This will be used together with sstables::read_range_rows
to migrate sstables::as_mutation_source().
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
Don't use streamed_mutation in mp_row_consumer
and sstable_mutation_reader.
Also use sstable_mutation_reader in sstable::read_row.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
It will be used in sstable_mutation_reader when the reader
will be used to implement sstable::read_row.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
Streamed mutation won't be used any more so get_next_partition
and on_partition_finished are more suitable names.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
Those methods have to be below sstable_mutation_reader because
they will be using the reader instead of streamed_mutation.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This is the first step which still uses streamed_mutation.
Next step will be to get rid of streamed_mutation.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This patchset prepares sstables read path for flat_mutation_reader.
It cuts some dependencies between classes and replaces
sstables::mutation_reader with ::mutation_reader. This will make it
possible to gradually convert the code to flat_mutation_reader because
we have converters between flat_mutation_reader and ::mutation_reader.
* seastar-dev.git haaawk/flat_reader_prepare_sstables_rebased
Reduce dependencies from mp_row_consumer to sstable_streamed_mutation
Replace sstables::mutation_reader with ::mutation_reader
Remove range_reader_adaptor
Remove sstable_range_wrapping_reader
The wrapper is no longer needed because
read_range_rows returns ::mutation_reader instead of
sstables::mutation_reader and the reader returned from
it keeps the pointer to shared_sstable that was used to
create the reader.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
The wrapper is no longer needed because
read_range_rows returns ::mutation_reader instead of
sstables::mutation_reader and the reader returned from
it keeps the pointer to shared_sstable that was used to
create the reader.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
This will make migration to flat_mutation_reader much
easier and sstables::mutation_reader is going away with
this migration anyway.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
Before this patch mp_row_consumer was using sstable_streamed_mutation
in two ways:
1. Populate sstable_streamed_mutation's buffer with mutation_fragments
2. Advance sstable_streamed_mutation's sstable_data_source to new position.
We can easily reduce those dependencies only to the first one.
This will reduce the coupling between those classes and simplify
the flow of execution.
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
"Otherwise, such strategies couldn't behave as expected when it needs to do STCS."
* 'respecting_stcs_options_v2' of github.com:raphaelsc/scylla:
tests: enable twcs test that relied on size-tiered properties
twcs: respect stcs options by forwarding them to stcs method
lcs: forward stcs options to respect them
stcs: make most_interesting_bucket respect size-tiered options
stcs: make most_interesting_bucket respect thresholds
compaction: make size_tiered_most_interesting_bucket static method of stcs class
stcs: introduce new ctor
stcs: make header self contained
stcs: inline function definition so as not to break one definition rule
Broken in f570e41d18.
Not replicating this may cause coordinator to treat a node which is
down as alive, or vice verse.
Fixes regression in dtest:
consistency_test.py:TestAvailability.test_simple_strategy
which was expected to get "unavailable" exception but it was getting a
timeout.
Message-Id: <1510666967-1288-1-git-send-email-tgrabiec@scylladb.com>
Make sure loading_cache::stop() is always called where appropriate:
regardless whether the test failed or there was an exception during the test.
Otherwise a false-alarm use-after-free error may occur.
Fixes#2955
Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <1510625736-3109-1-git-send-email-vladz@scylladb.com>
"Fixes #2944."
* tag 'tgrabiec/cache-exception-safety-fixes-v2' of github.com:scylladb/seastar-dev:
tests: row_cache: Add test for exception safety of multi-partition scans
tests: row_cache: Add test for exception safety of single-partition reads
tests: mutation_source_tests: Always print the seed
tests: Disable alloc failure injection in test assertions
tests: Avoid needless copies
row_cache: Fix exception safety of cache_entry::read()
row_cache: scanning_and_populating_reader: Fix exception unsafety causing read to skip data
row_cache: partition_range_cursor: Extract valid() and advance_to() from refresh()
cache_streamed_mutation: Add trace-level logging to cache_streamed_mutation
mvcc: Lift noexcept off partition_snapshot_row_weakref assignment/constructors
cache_streamed_mutation: Make advancing to the next range exception-safe
cache_streamed_mutation: Make add_clustering_row_to_buffer() exception-safe
cache_streamed_mutation: Make drain_tombstones() exception-safe
cache_streamed_mutation: Return void from start_reading_from_underlying()
cache_streamed_mutation: Document invariants related to exception-safety
streamed_mutation: Add reserve_one()
lsa: Guarantee invalidated references on allocating section retry
mvcc: partition_snapshot_row_cursor: Mark allocation points
BOOST_TEST_MESSAGE() is not logged by default, and for some tests we
don't want to enable that because it's too noisy. But we need to know
the seed to reproduce a failure, so we better to always print it.
If assignment to _lower_bound in the "_secondary_in_progress = true;"
case in do_read_from_primary() throws due to allocation failure, the
update section will be retried and we will take the not_moved path,
skipping the range which was discontinuous and was supposed to be read
from underlying.
Fix by redoing lookup using _lower_bound in case the section is
retried. When we retry, _primary.valid() will be false. We need to
ensure now that _lower_bound is always valid.
Fixes#2944.
Changing _ck_ranges_curr and _lower_bound should be atomic, either
both fail or both succeed. Currently it could happen that if
position_in_partition::for_range_start() fails, _ck_ranges_curr would
be advanced but _lower_bound not.
We need to maintain the following invariants:
(1) no fragment with position >= _lower_bound was pushed yet
(2) If _lower_bound > mf.position(), mf was emitted
Before this patch (1) could be violated if drain_tombstones() failed
in the middle. (2) could be violated if push_mutation_fragment()
failed.