SequenceStore での処理が失敗したときに正常に採番できないケースがある問題を解決します#57
Merged
tksugimoto merged 34 commits intofeature/fix-sequence-factoryfrom Sep 28, 2021
Merged
SequenceStore での処理が失敗したときに正常に採番できないケースがある問題を解決します#57tksugimoto merged 34 commits intofeature/fix-sequence-factoryfrom
tksugimoto merged 34 commits intofeature/fix-sequence-factoryfrom
Conversation
06f12ec to
c80c086
Compare
SequenceFactoryWorker で SequenceStore と採番値の 2 つの状態の管理を 行っていて実装が複雑になっている問題を解消します
予約途中に SequenceFactoryWorker が追加の予約要求をしないようにしていた実装を削除したため
c80c086 to
2ab6ac1
Compare
This reverts commit 2ab6ac1. sequenceSubId は混在して SequenceStore に採番予約を行うため、 採番予約要求を間引いてしまうと一部の sequenceSubId の予約に失敗してしまう
tksugimoto
reviewed
Sep 7, 2021
lerna-util-sequence/src/main/scala/lerna/util/sequence/SequenceFactoryWorker.scala
Show resolved
Hide resolved
tksugimoto
reviewed
Sep 7, 2021
lerna-util-sequence/src/main/scala/lerna/util/sequence/SequenceFactoryWorker.scala
Outdated
Show resolved
Hide resolved
tksugimoto
reviewed
Sep 8, 2021
lerna-util-sequence/src/main/scala/lerna/util/sequence/SequenceFactoryWorker.scala
Outdated
Show resolved
Hide resolved
tksugimoto
reviewed
Sep 8, 2021
lerna-util-sequence/src/test/scala/lerna/util/sequence/SequenceFactoryWorkerSpec.scala
Outdated
Show resolved
Hide resolved
tksugimoto
reviewed
Sep 13, 2021
lerna-util-sequence/src/test/scala/lerna/util/sequence/SequenceFactoryWorkerSpec.scala
Outdated
Show resolved
Hide resolved
tksugimoto
reviewed
Sep 13, 2021
lerna-util-sequence/src/test/scala/lerna/util/sequence/SequenceFactoryWorkerSpec.scala
Show resolved
Hide resolved
This was referenced Sep 24, 2021
SequenceFactoryWorker の予約中という状態を削ったため、不要になりました
8410a62 to
5a62c30
Compare
tksugimoto
previously approved these changes
Sep 27, 2021
tksugimoto
reviewed
Sep 27, 2021
lerna-util-sequence/src/test/scala/lerna/util/sequence/SequenceFactoryWorkerSpec.scala
Show resolved
Hide resolved
次のテストケースはシナリオが同じであり、重複していたため片方を削除します - 採番値が枯渇しているときに予約に失敗した場合は次の採番要求で再度予約が要求される - 採番値が枯渇しているときに予約が失敗した場合は次の採番要求で再度予約が要求される
tksugimoto
approved these changes
Sep 28, 2021
This was referenced Oct 4, 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
SequenceFactoryWorkerのSequenceStoreの応答があるまで追加の採番値を予約するのを控える実装を廃止しますSequenceFactoryWorkerは採番できる値があるのか、あるいは無いのかの基準でのみ振る舞いを変えますSequenceFactoryWorkerがSequenceStoreの状態によらず採番値を予約するようになったことにより Cassandra へのクエリ発行の頻度が高くなることが予想されます。そこでSequenceStore側で不要な書き込みを行わないよう処理対象とする予約を調整しますSequenceStoreは複数のsequenceSubIdで共有する構造のため、sequenceSubIdを考慮して予約の調整を行う必要がありました。そのような細かな調整を行うと実装が複雑になることが予想されるため、調整はしない方針としました。maxSequenceValueを超えた採番値予約も許可していました(ただし、採番時に採番しない制御をしていた)が、 仕様の複雑性を軽減するため、そもそもmaxSequenceValueを超えた採番値の予約を行わないよう変更しました 59c6134