Skip to content

masstree: remove_value_if_present() を追加し DELETE-commit パスで使用 (#59)#79

Merged
thawk105 merged 1 commit into
masterfrom
masstree-remove-value-if-present
May 14, 2026
Merged

masstree: remove_value_if_present() を追加し DELETE-commit パスで使用 (#59)#79
thawk105 merged 1 commit into
masterfrom
masstree-remove-value-if-present

Conversation

@thawk105
Copy link
Copy Markdown
Owner

Closes #59

変更内容

MasstreeWrapper に戻り値 void の「あれば消す」wrapper remove_value_if_present(std::string_view) を追加し、DELETE-commit 文脈で Status を捨てている 8 callsite (5 protocol) を置き換えた。

wrapper 追加

include/masstree_wrapper.hhremove_value()(void) で呼ぶだけの薄い wrapper。(void) キャストの boilerplate を消し、「Status を意図的に捨てている」というシグナルを呼び出し側に与える。

// "delete if present" — discards "not found" since callers in the
// DELETE-commit path may race with concurrent deletions of the same key.
void remove_value_if_present(std::string_view key) {
  (void) remove_value(key);
}

置き換えた callsite (8 箇所 / 5 protocol)

Protocol Callsite
silo cc/silo/transaction.cc:30, cc/silo/transaction.cc:557
mocc cc/mocc/transaction.cc:961, cc/mocc/transaction.cc:1050
tictoc cc/tictoc/transaction.cc:480, cc/tictoc/transaction.cc:529
ss2pl cc/ss2pl/transaction.cc:88
d2pl cc/d2pl/transaction.cc:88

(void)...remove_value(...) だった 5 箇所、および元々戻り値レスで ...remove_value(...) を呼んでいた 3 箇所を、すべて ...remove_value_if_present(...) に統一。MasstreeWrapper 側 + callsite 置き換えのみで、protocol-specific なロックタイミング・GC キュー push 順序には一切触れていない。DELETE-commit 文脈でない remove_value 呼び出し (Status を実際に使うもの) は変更なし。

Test plan

GCC 13 (CI と同じコンパイラ) で全バイナリをフルビルド。5 protocol 含め全 target 緑 (exit 0)。

  • Release (-DCMAKE_BUILD_TYPE=Release -DENABLE_SANITIZER=OFF): OK
  • Debug + ASan (-DCMAKE_BUILD_TYPE=Debug -DENABLE_SANITIZER=ON): OK

@thawk105 thawk105 merged commit 4f0ce2b into master May 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DELETE-commit 5 protocol で remove_value() の Status 捨て分岐が重複 → MasstreeWrapper 側に void wrapper を追加して統一

1 participant