Repository navigation
Fix Silo TPC-C progress and tuple lifetime under contention - #124
Merged
Merged
Conversation
Reset absent per operation and release the current lock on an absent target to prevent Delivery from leaving permanently locked Order records. Register published INSERT ownership before node validation and retire removed tuples with epochs sampled after index removal. Pin epochs at begin, abort reads of pending INSERTs, and observe quit during lock waits. Preserve staged updates and stable scan results so repeated Stock updates and read-own-writes behave consistently. Add 14 deterministic regression cases and run them in CI. All cases fail against the baseline and pass in normal and ASan builds; the standard mix with eight workers and one warehouse now completes the 30-second check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Siloで標準TPC-Cミックスを8 worker・1 warehouseで実行すると、測定終了後もworkerが
read_internal()で待機し続け、メインスレッドがjoin()から戻れなくなることがあります。本PRでは、ロックが残り続ける経路とTupleの寿命管理を修正し、read/scanが未コミットINSERTに遭遇した場合はトランザクションをabortして通常の再試行へ進めるようにします。原因と修正内容
Deliveryのwrite setでは、NewOrderのDELETEがOrder/OrderLineのUPDATEより先に処理されます。修正前の
writePhase()は、DELETEで設定したmaxtid.absent=trueを後続のUPDATEにも引き継ぎ、更新したレコードを誤って「存在しない」状態にしていました。その後、そのレコードのロックを取得した更新トランザクションがabortする際、現在のwrite set要素を解除対象に含めず、ロックを残したまま戻っていました。操作ごとにabsentビットを設定し、absentレコードを検出した場合は現在取得したロックまで解除します。DELETEもabsentレコードを拒否し、同じTupleを二重にGCへ登録することを防ぎます。
関連するトランザクション処理も、次のように修正します。
begin()で保護対象のepochを公開し、validation中もそのepochを保持します。回収用のepochはcommit TIDと分けて管理し、indexからの除去後に取得します。ReclamationEpochへのアクセスもatomicにします。CCBENCH_BUILD_SILO_TESTSで有効化できる、実行タイミングに依存しない回帰テスト14件を追加し、CIでも実行します。検証結果
extime=3で、3回とも25秒の制限時間を超えました。gdbでは、quitが設定された後もworkerがread_internal()で待機し、メインスレッドがjoin()を待つ状態を確認しました。-Wall -Wextra -Werrorで全プロトコルのターゲットがビルドできました。git diff --checkが通りました。回帰テストの実行方法:
このcheckoutにはTAMの実装がないため、TAMを有効にした実行は未検証です。上記の実走は、記載した条件と時間における正しさの確認です。性能比較を目的とした測定ではありません。長時間のストレステスト、ThreadSanitizer、GCC 13によるCI相当のビルドは、ローカルでは未検証です。
本修正とPR本文は、AIの支援を受けて作成しました。