Skip to content

Commit

Permalink
cleanup: explicit wso refcnt for update/upsert constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
ban-nobuhiro committed Jan 24, 2025
1 parent 70e38e8 commit 2c7c534
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
9 changes: 0 additions & 9 deletions src/concurrency_control/include/local_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,15 +69,6 @@ static_assert(std::is_nothrow_move_constructible_v<read_set_obj>);
class write_set_obj { // NOLINT
public:
// for update / upsert / insert
write_set_obj(Storage const storage, OP_TYPE const op,
Record* const rec_ptr, std::string_view const val)
: storage_(storage), op_(op), rec_ptr_(rec_ptr), val_(val) {
if (op == OP_TYPE::DELETE) {
LOG_FIRST_N(ERROR, 1) << log_location_prefix << "unreachable path";
}
}

// for upsert / insert
write_set_obj(Storage const storage, OP_TYPE const op,
Record* const rec_ptr, std::string_view const val,
bool const inc_tombstone)
Expand Down
3 changes: 1 addition & 2 deletions src/concurrency_control/interface/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ Status update_body(Token token, Storage storage,
}

// prepare write
ti->push_to_write_set(
{storage, OP_TYPE::UPDATE, rec_ptr, val}); // NOLINT
ti->push_to_write_set({storage, OP_TYPE::UPDATE, rec_ptr, val, false});
register_read_if_ltx(ti, rec_ptr);
return Status::OK;
}
Expand Down
3 changes: 1 addition & 2 deletions src/concurrency_control/interface/upsert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ Status upsert_body(Token token, Storage storage, const std::string_view key,
}
if (rc == Status::WARN_ALREADY_EXISTS) {
// prepare update
ti->push_to_write_set(
{storage, OP_TYPE::UPSERT, rec_ptr, val}); // NOLINT
ti->push_to_write_set({storage, OP_TYPE::UPSERT, rec_ptr, val, false});
return Status::OK;
}
if (rc == Status::WARN_CONCURRENT_INSERT) { continue; } // else
Expand Down

0 comments on commit 2c7c534

Please sign in to comment.