Fix/leveldb transaction - #40
Merged
Merged
Conversation
somasekimoto
requested changes
Nov 11, 2025
|
|
||
| #[test] | ||
| fn test_create_operation_rolls_back_on_state_failure() { | ||
| let dir = tempdir().unwrap(); |
Contributor
There was a problem hiding this comment.
[should]
commit_operationのテストもっとほしいですね。
もっと別パターンのテストも書いておいた方が良いと思います。
- それぞれ(4種類)のOperationTypeで失敗
- state.apply失敗
- batch_guard.commit の失敗
少なくともこの6ケースはあった方が良いかと。簡単にでも良いので
| repo.state.get_operation(&op_id).unwrap().is_none(), | ||
| "operation was persisted despite failure" | ||
| ); | ||
| } |
Contributor
There was a problem hiding this comment.
[ask]
rollback_pending_nodesのテストってないですよね?作った方が良い気がします。
somasekimoto
approved these changes
Nov 16, 2025
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.
Description
以前報告された「dag.add_child_node と state.apply の片方だけが成功すると整合性が崩れる」問題(コメント)に対処し、Repo の操作を「全成功か全失敗か」の一貫性で永続化できるようにした。
SharedLeveldbを導入し、書き込みを単一 LevelDB のWriteBatchでまとめて扱うように変更LeveldbStorage/LeveldbNodeStorageがアクティブなバッチを検知してバッチ経由で書き込み、バッチが無い場合は従来通り直接書き込むようリファクタリングNotes & open questions