Skip to content

Commit

Permalink
refactor: improve occ node verify
Browse files Browse the repository at this point in the history
  • Loading branch information
thawk105 committed Feb 15, 2024
1 parent 88e0862 commit b3be3b5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/concurrency_control/include/local_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ class node_set {
Status update_node_set(yakushima::node_version64* nvp) {
std::lock_guard<std::shared_mutex> lk{get_mtx_set()};
for (auto&& elem : set_) {
// compare node version ptr
if (std::get<1>(elem) == nvp) {
yakushima::node_version64_body nvb = nvp->get_stable_version();
if (std::get<0>(elem).get_vinsert_delete() + 1 !=
Expand Down Expand Up @@ -402,9 +403,7 @@ class node_set {
for (auto&& itr : get_set()) {
auto old_id = std::get<0>(itr);
auto current_id = std::get<1>(itr)->get_stable_version();
if (old_id.get_vinsert_delete() !=
current_id.get_vinsert_delete() ||
old_id.get_vsplit() != current_id.get_vsplit()) {
if (!comp_ver_for_node_verify(old_id, current_id)) {
return Status::ERR_CC;
}
}
Expand Down

0 comments on commit b3be3b5

Please sign in to comment.