Commit Graph

13643 Commits

Author SHA1 Message Date
Tomasz Grabiec
e9ffe36d65 Merge "Remove sstable::read_rows" from Piotr
* seastar-dev.git haaawk/flat_reader_remove_read_rows:
  sstable_mutation_test: use read_rows_flat instead of read_rows
  perf_sstable: use read_rows_flat instead of read_rows
  Remove sstable::read_rows
2017-11-22 15:50:59 +01:00
Piotr Jastrzebski
0fdfd2c5bc Remove sstable::read_rows
It's no longer used. read_rows_flat is used everything instead.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:48:57 +01:00
Piotr Jastrzebski
571bac7336 perf_sstable: use read_rows_flat instead of read_rows
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:48:57 +01:00
Piotr Jastrzebski
da2f2164e9 sstable_mutation_test: use read_rows_flat instead of read_rows
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:48:57 +01:00
Tomasz Grabiec
aa8c2cbc16 Merge "Migrate sstables to flat_mutation_reader" from Piotr
Introduce sstable::read_row_flat and sstable::read_range_rows_flat methods
and use them in sstable::as_mutation_source.

* https://github.com/scylladb/seastar-dev/tree/haaawk/flat_reader_sstables_v3:
  Introduce conversion from flat_mutation_reader to streamed_mutation
  Add sstables::read_rows_flat and sstables::read_range_rows_flat
  Turn sstable_mutation_reader into a flat_mutation_reader
  sstable: add getter for filter_tracker
  Move mp_row_consumer methods implementations to the bottom
  Remove unused sstable_mutation_reader constructor
  Replace "sm" with "partition" in get_next_sm and on_sm_finished
  Move advance_to_upper_bound above sstable_mutation_reader
  Store sstable_mutation_reader pointer in mp_row_consumer
  Stop using streamed_mutation in consumer and reader
  Stop using streamed_mutation in sstable_data_source
  Delete sstable_streamed_mutation
  Introduce sstable::read_row_flat
  Migrate sstable::as_mutation_source to flat_mutation_reader
  Remove single_partition_reader_adaptor
  Merge data_consume_context::impl into data_consume_context
  Create data_consume_context_opt.
  Merge on_partition_finished into mark_partition_finished
  Check _partition_finished instead of _current_partition_key
  Merge sstable_data_source into sstable_mutation_reader
  Remove sstable_data_source
  Remove get_next_partition and partition_header
2017-11-22 15:45:21 +01:00
Calle Wilund
912d29e79b storage_service: don't use potentially stale iterator in log
Message-Id: <20171121115119.29642-2-calle@scylladb.com>
2017-11-22 15:26:56 +01:00
Piotr Jastrzebski
df110e8b4d Remove get_next_partition and partition_header
Handle next_partition in on_next_partition instead.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:24:49 +01:00
Piotr Jastrzebski
a3b69235e3 Remove sstable_data_source
It's not used any more and can be safely removed.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:24:49 +01:00
Piotr Jastrzebski
4b9a34a854 Merge sstable_data_source into sstable_mutation_reader
There's no need for sstable_data_source to be separated any more.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:24:49 +01:00
Piotr Jastrzebski
f2191e0984 Check _partition_finished instead of _current_partition_key
to check whether partition is finished. In next patch
_current_partition_key will be merged with sstable_data_source::_key
and won't be cleared any more.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:24:49 +01:00
Piotr Jastrzebski
be0c9040a6 Merge on_partition_finished into mark_partition_finished
This simplifies code quite a bit.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:24:49 +01:00
Piotr Jastrzebski
8afbe0ead0 Create data_consume_context_opt.
This will be used in sstable_mutation_reader before
first fill_buffer is called and a proper data_consume_context
is created.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-22 15:24:22 +01:00
Duarte Nunes
3d24eed39e service/storage_service: Remove outdated FIXME
Thrift server is now a bit more graceful on shutdown.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
Message-Id: <20171121214341.31165-1-duarte@scylladb.com>
2017-11-22 10:48:46 +02:00
Piotr Jastrzebski
7f8b62bc0b Merge data_consume_context::impl into data_consume_context
There's no reason to use pimpl in data_consume_context

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-21 20:22:38 +01:00
Takuya ASADA
c1b97d11ea dist/redhat: avoid hardcoding GPG key file path on scylla-epel-7-x86_64.cfg
Since we want to support cross building, we shouldn't hardcode GPG file path,
even these files provided on recent version of mock.

This fixes build error on some older build environment such as CentOS-7.2.

Fixes #3002

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <1511277722-22917-1-git-send-email-syuu@scylladb.com>
2017-11-21 17:25:39 +02:00
Vladimir Krivopalov
61b1988aa1 Use meaningful error messages when throwing a marshal_exception
Fixes #2977

Signed-off-by: Vladimir Krivopalov <vladimir@scylladb.com>
Message-Id: <20171121005108.23074-1-vladimir@scylladb.com>
2017-11-21 16:05:43 +02:00
Daniel Fiala
21ea05ada1 utils/big_decimal: Fix compilation issue with converion of cpp_int to uint64_t.
Signed-off-by: Daniel Fiala <daniel@scylladb.com>
Message-Id: <20171121134854.16278-1-daniel@scylladb.com>
2017-11-21 15:51:29 +02:00
Tomasz Grabiec
6969a235f3 Merge "Convert queries to flat mutation readers" from Paweł
These patches convert queries (data, mutation and counter) to flat
mutation readers. All of them already use consume_flattened() to
consume a flat stream of data, so the only major missing thing
 was adding support for reversed partitions to
flat_mutation_reader::consume().

* pdziepak flat_mutation_reader-queries/v3-rebased:
  flat_mutation_reader: keep reference to decorated key valid
  flat_muation_reader: support consuming reversed partitions
  tests/flat_mutation_reader: add test for
    flat_mutation_reader::consume()
  mutation_partition: convert queries to flat_mutation_readers
  tests/row_cache_stress_test: do not use consume_flattened()
  mutation_reader: drop consume_flattened()
  streamed_mutation: drop reverse_streamed_mutation()
2017-11-21 12:55:57 +01:00
Paweł Dziepak
8baf682216 streamed_mutation: drop reverse_streamed_mutation() 2017-11-21 11:37:04 +00:00
Paweł Dziepak
5753e85c6b mutation_reader: drop consume_flattened()
consume_flattened() has been fully replaced by
flat_mutation_reader::consume()
2017-11-21 11:37:04 +00:00
Paweł Dziepak
5851b86369 tests/row_cache_stress_test: do not use consume_flattened() 2017-11-21 11:37:04 +00:00
Paweł Dziepak
48c3db54c9 mutation_partition: convert queries to flat_mutation_readers 2017-11-21 11:37:04 +00:00
Paweł Dziepak
00c8b38a88 tests/flat_mutation_reader: add test for flat_mutation_reader::consume() 2017-11-21 11:37:04 +00:00
Paweł Dziepak
cdb30f74a8 flat_muation_reader: support consuming reversed partitions
Some queries may need the fragments that belong to partition to be
emitted in the reversed order. Current support for that is very limited
(see #1413), but should work reasonably well for small partitions.
2017-11-21 11:37:04 +00:00
Paweł Dziepak
c817adc809 flat_mutation_reader: keep reference to decorated key valid
consume_flattened() guarantees that partition key (passed by reference)
will be valid until the end of partition.
flat_mutation_reader::consume() provides the same interface for consumer
so it also should make sure that the key remains valid.
2017-11-21 11:37:04 +00:00
Paweł Dziepak
1b936876b7 streamed_mutation: make emit_range_tombstone() exception safe
For a time range tombstone that was already removed from a tree
is owned by a raw pointer. This doesn't end well if creation of
a mutation fragment or a call to push_mutation_fragment() throw.
Message-Id: <20171121105749.16559-1-pdziepak@scylladb.com>
2017-11-21 12:28:20 +01:00
Avi Kivity
c6fa727af0 tracing: add missing include
The IDE doesn't understand what lw_shared_ptr<> means without it,
though it does compile.
2017-11-21 13:24:07 +02:00
Piotr Jastrzebski
ae3259c9be position_in_partition: support _type in operator<<
It is useful to print position_in_partition::_type together
with other fields to have a full view of what does the position
represent.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
Message-Id: <d2d25155a656aa6c2cefcd4964abccfa31cc4c45.1511252093.git.piotr@scylladb.com>
2017-11-21 12:35:32 +02:00
Vlad Zolotarov
941aa20252 cql_transport::cql_server: fix the distributed prepared statements cache population
Don't std::move() the "query" string inside the parallel_for_each() lambda.
parallel_for_each is going to invoke the given callback object for each element of the range
and as a result the first call of lambda that std::move()s the "query" is going to destroy it for
all other calls.

Fixes #2998

Signed-off-by: Vlad Zolotarov <vladz@scylladb.com>
Message-Id: <1511225744-1159-1-git-send-email-vladz@scylladb.com>
2017-11-21 10:37:49 +02:00
Piotr Jastrzebski
644f9d9883 Remove single_partition_reader_adaptor
It is no longer used anywhere.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-20 16:26:54 +01:00
Piotr Jastrzebski
eb31ec00a2 Migrate sstable::as_mutation_source to flat_mutation_reader
Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-20 16:26:54 +01:00
Piotr Jastrzebski
11a354b144 Introduce sstable::read_row_flat
This will be used together with sstables::read_range_rows
to migrate sstables::as_mutation_source().

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-20 16:26:54 +01:00
Piotr Jastrzebski
65c6f339d6 Delete sstable_streamed_mutation
It's no longer used so can be safely removed.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-20 16:26:54 +01:00
Piotr Jastrzebski
e241b0c2de Stop using streamed_mutation in sstable_data_source
Use a partition_header instead.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-20 16:26:54 +01:00
Piotr Jastrzebski
375c321e9d Stop using streamed_mutation in consumer and reader
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>
2017-11-20 16:22:57 +01:00
Avi Kivity
ff19cdc092 Merge seastar upstream
* seastar 78cd87f...7f87529 (3):
  > exception: use phdr hash on reactor threads only
  > tests: httpd use noncopyable_function
  > Merge "fixes of issues found by seastar's unit tests" (ppc) from Vlad

Fixes #2967.
2017-11-20 17:16:52 +02:00
Botond Dénes
f059e71056 Add fast-forwarding with no data test to mutation_source_test
Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <9cb630bf9441e178b2040709f92767d4a740a875.1511180262.git.bdenes@scylladb.com>
2017-11-20 13:36:14 +01:00
Botond Dénes
a1a0d445d6 flat_mutation_reader_assertions: add fast_forward_to(position_range)
Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <7b530909cf188887377aec3985f9f8c0e3b9b1e8.1511180262.git.bdenes@scylladb.com>
2017-11-20 13:35:57 +01:00
Botond Dénes
8065dca4a1 flat_mutation_reader_from_mutation_reader(): make ff more resilient
Currently flat_mutation_reader_from_mutation_reader()'s
converting_reader will throw std::runtime_error if fast_forward_to() is
called when its internal streamed_mutation_opt is disengaged. This can
create problems if this reader is a sub-reader of a combined reader as the
latter has no way to determine the source of a sub-reader EOS. A reader
can be in EOS either because it reached the end of the current
position_range or because it doesn't have any more data.
To avoid this, instead of throwing we just silently ignore the fact that
the streamed_mutation_opt is disengaged and set _end_of_stream to true
which is still correct.

Signed-off-by: Botond Dénes <bdenes@scylladb.com>
Message-Id: <83d309b225950bdbbd931f1c5e7fb91c9929ba1c.1511180262.git.bdenes@scylladb.com>
2017-11-20 13:35:42 +01:00
Duarte Nunes
34a0b85982 thrift/server: Handle exception within gate
The exception handling code inspects server state, which could be
destroyed before the handle_exception() task runs since it runs after
exiting the gate. Move the exception handling inside the gate and
avoid scheduling another accept if the server has been stopped.

Signed-off-by: Duarte Nunes <duarte@scylladb.com>
Message-Id: <20171116122921.21273-1-duarte@scylladb.com>
2017-11-20 13:55:14 +02:00
Takuya ASADA
f26cde582f configure.py: suppress 'nonnull-compare' warning on antlr3
We get following warning from antlr3 header when we compile Scylla with gcc-7.2:
/opt/scylladb/include/antlr3bitset.inl: In member function 'antlr3::BitsetList<AllocatorType>::BitsetType* antlr3::BitsetList<AllocatorType>::bitsetLoad() [with ImplTraits = antlr3::TraitsBase<antlr3::CustomTraitsBase>]':
/opt/scylladb/include/antlr3bitset.inl:54:2: error: nonnull argument 'this' compared to NULL [-Werror=nonnull-compare]

To make it compilable we need to specify '-Wno-nonnull-compare' on cflags.

Message-Id: <1510952411-20722-2-git-send-email-syuu@scylladb.com>
2017-11-20 13:07:09 +02:00
Takuya ASADA
ab9d7cdc65 dist/debian: switch Debian 3rdparty packages to external build service
Switch Debian 3rdparty packages to our OBS repo
(https://build.opensuse.org/project/subprojects/home:scylladb).

We don't use 3rdparty packages on dist/debian/dep, so dropped them.
Also we switch Debian to gcc-7.2/boost-1.63 on same time.

Due to packaging issues following packages doesn't renamed our 3rdparty
package naming rule for now:
 - gcc-7: renamed as 'xxx-scylla72', instead of scylla-xxx-72.
 - boost1.63: doesn't renamed, also doesn't changed prefix to /opt/scylladb

Message-Id: <1510952411-20722-1-git-send-email-syuu@scylladb.com>
2017-11-20 13:07:04 +02:00
Tomasz Grabiec
cec5b0a5b8 Merge "Fix reversed queries with range tombstones" from Paweł
This series reworks handling of range tombstones in reversed queries
so that they are applied to correct rows. Additionally, the concept
of flipped range tombstones is removed, since it only made it harder
to reason about the code.

Fixes #2982.

* https://github.com/pdziepak/scylla fix-reverse-query-range-tombstone/v2:
  streamed_mutation: fix reversing range tombstones
  range_tombstone: drop flip()
  tests/cql_query_test: test range tombstones and reverse queries
  tests/range_tombstone_list: add test for range_tombstone_accumulator
2017-11-17 16:31:34 +01:00
Tomasz Grabiec
2113299b61 sstables: index_reader: Reset lower bound for promoted index lookups from advance_to_next_partition()
_current_pi_idx was not reset from advance_to_next_partition(), which
is used when we skip to the next partition before fully consuming
it. As a result, if we try to skip to a clustering position which is
before the index block used by the last skip in the previous
partition, we would not skip assuming that the new position is in the
current block. This may result in more data being read from the
sstable than necessary.

Fixes #2984
Message-Id: <1510915793-20159-1-git-send-email-tgrabiec@scylladb.com>
2017-11-17 11:00:26 +00:00
Piotr Jastrzebski
f7bf782a41 Store sstable_mutation_reader pointer in mp_row_consumer
The reader will be used by mp_row_consumer instead of streamed_mutation
in next patches.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-16 22:06:28 +01:00
Piotr Jastrzebski
145fcf846e Move advance_to_upper_bound above sstable_mutation_reader
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>
2017-11-16 22:06:28 +01:00
Piotr Jastrzebski
1c7938c44d Replace "sm" with "partition" in get_next_sm and on_sm_finished
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>
2017-11-16 22:06:28 +01:00
Piotr Jastrzebski
4943f52ad7 Remove unused sstable_mutation_reader constructor
The constructor is never used so it can be safely removed.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-16 22:06:28 +01:00
Piotr Jastrzebski
c7971eb8e3 Move mp_row_consumer methods implementations to the bottom
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>
2017-11-16 22:06:28 +01:00
Piotr Jastrzebski
19fcf8accf sstable: add getter for filter_tracker
This will be needed to use sstable_mutation_reader for
sstable::read_row.

Signed-off-by: Piotr Jastrzebski <piotr@scylladb.com>
2017-11-16 22:06:28 +01:00