複合障害が発生した場合 lerna-util-sequence で正常な採番ができない場合がある問題を修正#71
Merged
tksugimoto merged 46 commits intomainfrom Oct 18, 2021
Merged
Conversation
テストケース抽出ツール pict を使って洗い出しました
after_remainAmount を削除したので、after_remainAmount によって決まる @after_freeAmount が代わりに因子になる
*.pict ファイルへのテストケース書き出しを自動化
PICT の生成結果を .pict ファイルに追記するスクリプトを作成
isStarving, generated.isStarving, generated.isOverflow, @採番値予約, @採番値リセット が不要になりました。 リトライ部分は処理ロジック的にはリスクを感じるほど複雑ではないため、コードレビュー + 既存のテストケースでカバーします
#57 その他含まれる変更 - SequenceFactoryWorker の SequenceStore の応答があるまで追加の採番値を予約するのを控える実装を廃止します - SequenceFactoryWorker は採番できる値があるのか、あるいは無いのかの基準でのみ振る舞いを変えます - SequenceFactoryWorker が SequenceStore の状態によらず採番値を予約するようになったことにより Cassandra へのクエリ発行の頻度が高くなることが予想されます。 - 前のバージョンから存在していた問題ですが、採番値の予約時に余分に 1 つ多く採番値が予約されてしまう問題を解消しました - 前のバージョンでは maxSequenceValue を超えた採番値予約も許可していました(ただし、採番時に採番しない制御をしていた)が、 仕様の複雑性を軽減するため、そもそも maxSequenceValue を超えた採番値の予約を行わないよう変更しました
…ker-generate-pict
@received.isEmpty は Store からのリプライを受けた直後であり、採番の有無による影響を受けないため
No isEmpty isOverflow msg msg.maxReservedValue @received.isEmpty 14 TRUE TRUE SequenceReset = ctx.maxReservedValue FALSE のケースでも採番できるのが仕様としては望ましいことがわかった
必ずしも maxSequenceValue ぴったりまで採番できるとは限らないため
…ate-pict SequenceFactoryWorker の採番時の振る舞いについてテストケースを洗い出し
…rker-store-reply-pict
…-reply-pict SequenceFactoryWorker が SequenceStore から応答を受けたときの振る舞いのテストケースを検討する
… SequenceReset が返ってくることを想定するテストケースを削除
…tore-reply-pict 📚doc: オーバーフローしていない状態で msg.maxReservedValue < ctx.maxReservedValue となる SequenceReset が返ってくることを想定するテストケースを削除
可読性向上のため
コメントの意味が分かりづらかったため
incrementStep(maxNodeId) が 10 のとき、firstValue が 11 になることはない
コメントの意味が分かりづらかったため
…est/SequenceFactoryWorker SequenceFactoryWorker テストケース改善
tksugimoto
approved these changes
Oct 18, 2021
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.
Closes #49
次の課題が残りましたが、内部仕様の問題であり、採番機能自体には影響しません
本ブランチは次の PR を含んでいます