Commit Graph

18942 Commits

Author SHA1 Message Date
Asias He
b7b5cb33e8 remove get_row_diff 2019-07-11 08:36:39 +08:00
Asias He
b7abaa04da repair: Futurize get_row_diff to avoid stall
The copy of _working_row_buf and boost::copy_range can stall if the
number of rows are big. Futurize get_row_diff to avoid stall.
2019-07-08 15:22:16 +08:00
Asias He
a4b24e44a3 repair: Fix possible stall in request_row_hashes
The std::find_if and std::copy can stall if the number of rows are big.
Introduce a helper move_row_buf_to_working_row_buf to move the rows
that yields to avoid stall.
2019-07-08 15:22:16 +08:00
Asias He
b48dc42e73 repair: Allow default construct for repair_row
All members of repair_row are now optional. Enable the default
constructor so that _row_buf.resize() can work.
2019-07-08 15:22:16 +08:00
Asias He
18fb0714a0 repair: Remove apply_rows
It is not used any more. The user now calls
apply_rows_on_master_in_thread and apply_rows_on_follower instead.
2019-07-08 15:22:16 +08:00
Asias He
882530ce26 repair: Run get_row_diff_with_rpc_stream in a thread
So that we can make get_row_diff_source_op run inside a thread, in turn
it can now call apply_rows_on_master_in_thread which eliminates stall.
2019-07-08 15:22:16 +08:00
Asias He
948b833d74 repair: Run get_row_diff_and_update_peer_row_hash_sets inside a thread
So it can use apply_rows_on_master_in_thread which eliminates stall.
2019-07-08 15:22:16 +08:00
Asias He
7f29d13984 repair: Run get_row_diff inside a thread
So it can use apply_rows_on_master_in_thread which elimiates stall.
2019-07-08 15:22:16 +08:00
Asias He
6b2e3946fb repair: Add apply_rows_on_master_in_thread
Like apply_rows, except it runs inside a thread and runs on master node
only.
2019-07-08 15:22:16 +08:00
Asias He
7c6a29027f repair: Add apply_rows_on_follower
Add a version for apply_rows on follower node only.
2019-07-08 15:22:16 +08:00
Asias He
cc14c6e0c4 repair: Futurize working_row_hashes
To avoid stall when the number of rows is big.
2019-07-08 15:22:16 +08:00
Asias He
f3d2ba6ec7 repair: Remove get_full_row_hashes helper
It is a single wrapper for working_row_hashes and is used only once. Remove it.
2019-07-08 15:22:16 +08:00
Benny Halevy
a0499bbd31 lister::guarantee_type: do not follow symlink
Simliar to commit 9785754e0d
lister::guarantee_type needs to check the entry's type,
not the symlink it may point to.

Fixes #4606

The nodetool_refresh_with_wrong_upload_modes_test dtest creates a broken
symlink and following it fails, as it should, with the default follow_symlink::yes

Signed-off-by: Benny Halevy <bhalevy@scylladb.com>
Message-Id: <20190626110734.4558-1-bhalevy@scylladb.com>
2019-07-07 15:29:28 +03:00
Avi Kivity
63edd46562 Merge "Expand big decimal with arithmetic operators" from Piotr
"
This miniseries expands big_decimal interface with convenience operators
(-=, +, -), provides test cases for it and makes one of the constructors
explicit.

Tests: unit(dev)
"

* 'expand_big_decimal_interface' of https://github.com/psarna/scylla:
  utils: make string-based big decimal constructor explicit
  tests: add more operators to big decimal tests
  utils: add operators to big_decimal
2019-07-06 12:26:08 +03:00
Avi Kivity
24caf0824d Merge "Complete the LIKE operator" from Dejan
"
Implement LIKE parsing, intermediate representation, and query processing. Add tests
for this implementation (leaving the LIKE functionality tests in
tests/like_matcher_test.cc).

Refs #4477.
"

* 'finish-like' of https://github.com/dekimir/scylla:
  cql3: Add LIKE operator to CQL grammar
  cql3: Ensure LIKE filtering for partition columns
  cql3: Add LIKE restriction
  cql3: Add LIKE relation
2019-07-06 12:26:08 +03:00
kbr-
8995945052 Implement tuple_type_impl::to_string_impl. (#4645)
Resolves #4633.

Signed-off-by: Kamil Braun <kbraun@scylladb.com>
2019-07-06 12:26:08 +03:00
Avi Kivity
187859ad78 review-checklist: mention that the guidelines are not absolute rules and can be overridden 2019-07-06 12:26:08 +03:00
Piotr Sarna
eed2543bcc utils: make string-based big decimal constructor explicit
As a rule of thumb, single-parameter constructors should be explicit
in order to avoid unexpected implicit conversions.
2019-07-04 11:33:00 +02:00
Piotr Sarna
7e722f8dd5 tests: add more operators to big decimal tests 2019-07-04 11:32:57 +02:00
Piotr Sarna
a5e41408ec utils: add operators to big_decimal
For convenience, operators -=, + and - are implemented on top of +=.
2019-07-04 11:32:53 +02:00
Dejan Mircevski
6727e8f073 cql3: Add LIKE operator to CQL grammar
Extend the grammar with LIKE and add CQL query tests for it.

Signed-off-by: Dejan Mircevski <dejan@scylladb.com>
2019-07-04 11:01:13 +02:00
Dejan Mircevski
1c583de8bb cql3: Ensure LIKE filtering for partition columns
Partition columns are implicitly filtered whenever possible, avoiding
expensive post-processing.  But there are exceptions, eg, when
partition key is only partially restricted, or for CONTAINS
expressions.  Here we add LIKE to this list of exceptions.

Also fix compute_bounds() to punt on LIKE restrictions, which cannot
be translated into meaningful bounds.

Signed-off-by: Dejan Mircevski <dejan@scylladb.com>
2019-07-04 10:59:13 +02:00
Dejan Mircevski
63cec653e5 cql3: Add LIKE restriction
This restriction leverages like_matcher to perform filtering.

Make single_column_relation::new_LIKE_restriction() return this new
restriction.

Signed-off-by: Dejan Mircevski <dejan@scylladb.com>
2019-07-04 10:58:56 +02:00
Dejan Mircevski
21d7722594 cql3: Add LIKE relation
Add a new type of relation with operator LIKE.  Handle it in
relation::to_restriction by introducing a new virtual method for it.
The temporary implementation of this method returns null; that will be
replaced in a subsequent patch.

Add abstract_type::is_string() to recognize string columns and
disallow LIKE operator on non-string columns.

Signed-off-by: Dejan Mircevski <dejan@scylladb.com>
2019-07-04 10:54:30 +02:00
Avi Kivity
8a0c4d508a Merge "Repair switch to rpc stream" from Asias
"
The put_row_diff, get_row_dif and get_full_row_hashes verbs are switched
to use rpc stream instead of rpc verb. They are the verbs that could
send big rpc messages. The rpc stream sink and source are created per
repair follower for each of the above 3 verbs. The sink and source are
shared for multiple requests during the entire repair operation for a
given range, so there is no overhead to setup rpc stream.

The row buffer is now increased to 32MiB from 256KiB, giving better
bandwidth in high latency links. The downside of bigger row buffer is
reduced possibility that all the rows inside a row buffer are identical.
This causes more full hashes to be exchanged. To address this issue, the
plan is to add better set reconciliation algorithm in addition to the
current send full hashes.

I compared rebuild using regular stream plan with repair using rpc
stream. With 2 nodes, 1 smp, 8M rows, delete all data on one of the
node before repair or rebuild.

    repair using seastar rpc verb

Time to complete: 82.17s

    rebuild using regular streaming which uses seastar rpc stream

Time to complete: 63.87s

    repair using seastar rpc stream

Time to complete: 68.48s

For 1) and 3), the improvement is 16.6% (repair using rpc verb v.s. repair using rpc stream)

For 2) and 3), the difference is 7.2% (repair v.s. stream)

The result is promising for the future repair-based bootstrap/replace node operations.

NOTE: We do not actually enable rpc stream in row level repair for now. We
will enable it after we fix the the stall issues caused by handling
bigger row buffers.

Fixes #4581
"

* 'repair_switch_to_rpc_stream_v9' of https://github.com/asias/scylla: (45 commits)
  docs: Add RPC stream doc for row level repair
  repair: Mark some of the helper functions static
  repair: Increase max row buf size
  repair: Hook rpc stream version of verbs in row level repair
  repair: Add use_rpc_stream to repair_meta
  repair: Add is_rpc_stream_supported
  repair: Add needs_all_rows flag to put_row_diff
  repair: Optimize get_row_diff
  repair: Register repair_get_full_row_hashes_with_rpc_strea
  repair: Register repair_put_row_diff_with_rpc_stream
  repair: Register repair_get_row_diff_with_rpc_stream
  repair: Add repair_get_full_row_hashes_with_rpc_stream_handler
  repair: Add repair_put_row_diff_with_rpc_stream_handler
  repair: Add repair_get_row_diff_with_rpc_stream_handler
  repair: Add repair_get_full_row_hashes_with_rpc_stream_process_op
  repair: Add repair_put_row_diff_with_rpc_stream_process_op
  repair: Add repair_get_row_diff_with_rpc_stream_process_op
  repair: Add put_row_diff_with_rpc_stream
  repair: Add put_row_diff_sink_op
  repair: Add put_row_diff_source_op
  ...
2019-07-03 10:08:55 +03:00
Asias He
f686f0b9d6 docs: Add RPC stream doc for row level repair
This documents RPC stream usage in row level repair.
2019-07-03 08:09:57 +08:00
Asias He
78ae5af203 repair: Mark some of the helper functions static
They are used only inside repair/row_level.cc. Make them static.
2019-07-03 08:09:57 +08:00
Asias He
e8c13444ba repair: Increase max row buf size
If the cluster supports row level repair with rpc stream interface, we
can use bigger row buf size to have better repair bandwidth in high
latency links.
2019-07-03 08:01:37 +08:00
Asias He
7d08a8d223 repair: Hook rpc stream version of verbs in row level repair
If rpc stream is supported, use the rpc stream version of the
get_row_diff, put_row_diff, get_full_row_hashes.
2019-07-03 08:01:37 +08:00
Asias He
fccaa0324f repair: Add use_rpc_stream to repair_meta
Determine if rpc stream should be used.
2019-07-03 08:01:37 +08:00
Asias He
7bf0c646be repair: Add is_rpc_stream_supported
Given a row_level_diff_detect_algorithm, return if this algo supports
rpc stream interface.
2019-07-03 08:01:04 +08:00
Asias He
1c92643f02 repair: Add needs_all_rows flag to put_row_diff
So we can avoid copy _working_row_buf in get_row_diff on master node if
there is only one follower node and all repair rows are needed by
follower node.
2019-07-03 07:56:22 +08:00
Asias He
6595417567 repair: Optimize get_row_diff
Move _working_row_buf instead of copy if it is follower node or
it is master node with only one follow. In these cases, the
_working_row_buf will not be used after this function, so we can move
it.
2019-07-03 07:56:22 +08:00
Asias He
c4eb0ee361 repair: Register repair_get_full_row_hashes_with_rpc_strea
Register the get_full_row_hashes rpc stream verb.
2019-07-03 07:56:22 +08:00
Asias He
b56cced5b8 repair: Register repair_put_row_diff_with_rpc_stream
Register the put_row_diff rpc stream verb.
2019-07-03 07:56:22 +08:00
Asias He
67130031b1 repair: Register repair_get_row_diff_with_rpc_stream
Register the get_row_diff rpc stream verb.
2019-07-03 07:56:22 +08:00
Asias He
f255f902bd repair: Add repair_get_full_row_hashes_with_rpc_stream_handler
It is the handler for the get_full_row_hashes rpc stream verb on the
receiving side.
2019-07-03 07:56:17 +08:00
Asias He
e3267ad98c repair: Add repair_put_row_diff_with_rpc_stream_handler
It is the handler for the put_row_diff rpc stream verb on the
receiving side.
2019-07-03 07:55:24 +08:00
Asias He
06ac014261 repair: Add repair_get_row_diff_with_rpc_stream_handler
It is the handler for the get_row_diff rpc stream verb on the receiving
side.
2019-07-03 07:54:43 +08:00
Asias He
5f25969da3 repair: Add repair_get_full_row_hashes_with_rpc_stream_process_op
It is the helper for the get_full_row_hashes rpc stream verb handler.
2019-07-03 07:54:03 +08:00
Asias He
39d5a9446e repair: Add repair_put_row_diff_with_rpc_stream_process_op
It is the helper for the put_row_diff rpc stream verb handler.
2019-07-03 07:53:21 +08:00
Asias He
049e793fe5 repair: Add repair_get_row_diff_with_rpc_stream_process_op
It is the helper for the get_row_diff rpc stream verb handler.
2019-07-03 07:52:12 +08:00
Avi Kivity
fca1ae69ff database: convert _cfg from a pointer to a reference
_cfg cannot be null, so it can be converted to a reference to
indicate this. Follow-up to fe59997efe.
2019-07-02 17:57:50 +02:00
Calle Wilund
f317d7a975 commitlog: Simplify commitlog extension iteration
Fixes #4640

Iterating extensions in commitlog.cc should mimic that in sstables.cc,
i.e. a simple future-chain. Should also use same order for read and
write open, as we should preserve transformation stack order.

Message-Id: <20190702150028.18042-1-calle@scylladb.com>
2019-07-02 18:37:44 +03:00
Takuya ASADA
332a6931c4 dist/redhat: fix install path of scripts
On recent changes install.sh mistakenly copies dist/common/scripts to
/opt/scylladb/scripts/scripts, it should be /opt/scylladb/scripts.
Same on /opt/scylladb/scyllatop as well.

Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Message-Id: <20190702120030.13729-1-syuu@scylladb.com>
2019-07-02 17:29:33 +03:00
Asias He
b1188f299e repair: Add put_row_diff_with_rpc_stream
It is rpc stream version of put_row_diff. It uses rpc stream instead of
rpc verb to put the repair rows to follower nodes.
2019-07-02 21:22:41 +08:00
Asias He
31b30486a7 repair: Add put_row_diff_sink_op
It is a helper that works on the sink() of the put_row_diff
rpc stream verb.
2019-07-02 21:22:41 +08:00
Asias He
dbe035649b repair: Add put_row_diff_source_op
It is a helper that works on the source() of the put_row_diff rpc
stream verb.
2019-07-02 21:22:41 +08:00
Asias He
72d3563da1 repair: Add get_row_diff_with_rpc_stream
It is rpc stream version of get_row_diff. It uses rpc stream instead of
rpc verb to get the repair rows from follower nodes.
2019-07-02 21:22:41 +08:00
Asias He
4cb44baa08 repair: Add get_row_diff_sink_op
It is a helper that works on the sink() of the get_row_diff rpc
stream verb.
2019-07-02 21:22:41 +08:00