-
Notifications
You must be signed in to change notification settings - Fork 2
masstree root lock の導入とそれによるメンバ変数保護 #52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
better handling of inlined values and non-ASCII characters
|
28915a5 の補足
|
include/base_node.h
Outdated
| void lock() { version_.lock(); } | ||
|
|
||
| /** | ||
| * @pre This function is called by split. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コードは問題ないのですが、関数のdoc commentに関数終了時に何がロックされた状態になるかという記述をしたほうがいいように思います。この関数以外でもそのあたりの記述が全体的に甘いですが、この関数の場合は特にnullptrを返すかどうかでロック対象が異なると思うのでそのあたりを注意喚起すべきと感じました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
改訂しました。 post と returns で同じ条件わけを書いて冗長になったので details 項を設けてそちらに移動しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ありがとうございます。よさげです。
kuron99
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
コメントしたものはdocumentation絡みの話なのでapproveします。
doc comment関連の変更はまとめて別のissue/PRでもいいかもしれません。
|
レビューありがとうございました。マージしました。 |
並行で delete を二つ実行した場合にタイミングによって masstree の root node が root bit を持たないという不整合状態になることがあり、それが起きてしまうと masstree の操作のほとんどができなくなるという不具合がありました。
案件: project-tsurugi/tsurugi-issues#1317
masstree の node は、操作対象の node 自身のロックによって保護されるメンバ変数のほかに、隣接 node (parent, prev) のロックによって保護されるメンバ変数があり、今回 parent node のロック (以下、「parent lock」) により保護されるメンバの見直しと、 parent が存在しない node の取り扱いを見直して、この問題を解消しました。
コミットの概略
lock_parent()内で実施するように変更display()の表示変更・コメントの変更・テストコードの修正 です