-
Notifications
You must be signed in to change notification settings - Fork 162
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
AKCORE-167-2: Minor bugfix, shareStateMap was being updated twice for a single WriteShareGroupState operation #1293
base: kip-932
Are you sure you want to change the base?
Conversation
…or a single wrteShareGroupState operation
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.
Please could you also improve the javadoc for the readState and writeState methods. The comments say what the current limitations are, but a sentence at the start to say what the method is for would be appropriate. Thanks.
@@ -251,20 +251,18 @@ public CoordinatorResult<WriteShareGroupStateResponseData, Record> writeState(Re | |||
WriteShareGroupStateResponseData responseData = new WriteShareGroupStateResponseData(); | |||
for (Record record : recordList) { // should be single record | |||
if (record.key().message() instanceof ShareSnapshotKey && record.value().message() instanceof ShareSnapshotValue) { | |||
ShareSnapshotKey newKey = (ShareSnapshotKey) record.key().message(); | |||
ShareSnapshotValue newValue = (ShareSnapshotValue) record.value().message(); | |||
ShareSnapshotKey recordKeyKey = (ShareSnapshotKey) record.key().message(); |
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.
recordKeyKey
??? I know it's trivial but please can we have a less comical name :)
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.
Thanks for the review, sorry about this 😅 The changes are there in the latest commit
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.
LGTM
According to the
CoordinatorRuntime
code, the replay method is called eventually, which should be responsible for the updations to the TimelineHashMaps (shareStateMap
in our case). The replay function correctly updates theshareStateMap
with the generated records, but an additional update to theshareStateMap
was being made in thewriteState
function to update the snapshot epoch, causing double updates for a singleWriteShareGroupState
operation. This PR removes this additional update in thewriteState
function and generates the corrected records with the correct snapshot epoch value, which will be put in theshareStateMap
during replay