Skip to content

Commit

Permalink
repair: Avoid copying position in to_repair_rows_list
Browse files Browse the repository at this point in the history
No need to make a copy because it is not used to construct repair_row
any more since commit 9079790 (repair:
Avoid writing row with same partition key and clustering key more than
once). Use mf->position() instead.

Refs: scylladb#4510
Backports: 3.1
Message-Id: <7b21edcc3368036b6357b5136314c0edc22ad4d2.1560753672.git.asias@scylladb.com>
  • Loading branch information
asias authored and avikivity committed Jun 17, 2019
1 parent 91b71a0 commit f323717
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions repair/row_level.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1055,13 +1055,12 @@ class repair_meta {
_metrics.rx_row_nr += 1;
_metrics.rx_row_bytes += fmf.representation().size();
auto mf = make_lw_shared<mutation_fragment>(fmf.unfreeze(*_schema));
position_in_partition pos(mf->position());
// If the mutation_fragment has the same position as
// the last mutation_fragment, it means they are the
// same row with different contents. We can not feed
// such rows into the sstable writer. Instead we apply
// the mutation_fragment into the previous one.
if (last_mf && cmp(last_mf->position(), pos) == 0 && last_mf->mergeable_with(*mf)) {
if (last_mf && cmp(last_mf->position(), mf->position()) == 0 && last_mf->mergeable_with(*mf)) {
last_mf->apply(*_schema, std::move(*mf));
} else {
last_mf = mf;
Expand Down

0 comments on commit f323717

Please sign in to comment.