Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
thawk105 committed Jul 19, 2023
1 parent 0fcc224 commit 12935eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions src/concurrency_control/interface/long_tx/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ extern Status version_traverse_and_read(session* const ti,

// read latest version after version function
if (is_latest) {
if (read_value) { ver->get_value(value); }
if (!f_check.get_absent()) {
if (read_value) { ver->get_value(value); }
}
if (ver == rec_ptr->get_latest() &&
loadAcquire(&rec_ptr->get_tidw_ref().get_obj()) ==
f_check.get_obj()) {
Expand All @@ -52,6 +54,7 @@ extern Status version_traverse_and_read(session* const ti,
if (read_epoch > ti->get_read_version_max_epoch()) {
ti->set_read_version_max_epoch(read_epoch);
}
if (f_check.get_absent()) { return Status::WARN_NOT_FOUND; }
return Status::OK;
}
/**
Expand All @@ -68,7 +71,9 @@ extern Status version_traverse_and_read(session* const ti,
if (ver == nullptr) {
LOG(ERROR) << log_location_prefix << "unreachable path";
}
if (read_value) { ver->get_value(value); }
if (!ver->get_tid().get_absent()) {
if (read_value) { ver->get_value(value); }
}
// check max epoch of read version
auto read_epoch{ver->get_tid().get_epoch()};
if (read_epoch > ti->get_read_version_max_epoch()) {
Expand Down Expand Up @@ -106,9 +111,7 @@ static Status check_before_execution(session* const ti, Storage const storage) {

static Status hit_local_write_set(write_set_obj* const in_ws, Record* rec_ptr,
std::string& value, bool const read_value) {
if (in_ws->get_op() == OP_TYPE::DELETE) {
return Status::WARN_NOT_FOUND;
}
if (in_ws->get_op() == OP_TYPE::DELETE) { return Status::WARN_NOT_FOUND; }
if (read_value) {
std::shared_lock<std::shared_mutex> lk{rec_ptr->get_mtx_value()};
in_ws->get_value(value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void wait_start_tx(Token tx) {
}
}

TEST_P(tsurugi_issue323, DISABLED_must_not_read_inserting_record) { // NOLINT
TEST_P(tsurugi_issue323, must_not_read_inserting_record) { // NOLINT
transaction_type write_tx_type = std::get<0>(GetParam());
transaction_type read_tx_type = std::get<1>(GetParam());
// setup
Expand Down

0 comments on commit 12935eb

Please sign in to comment.