-
Notifications
You must be signed in to change notification settings - Fork 833
Update ring DynamoDB Client to write in a transaction when batching #6987
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
Conversation
Signed-off-by: Anna Tran <trananna@amazon.com>
Signed-off-by: Anna Tran <trananna@amazon.com>
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 work.
One last comment talked offline. We can inprove the retry if failed before of condition error.
Signed-off-by: Anna Tran <trananna@amazon.com>
Signed-off-by: Anna Tran <trananna@amazon.com>
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
if item[version] != nil { | ||
parsedVersion, err := strconv.ParseInt(*item[version].N, 10, 0) | ||
if err != nil { | ||
kv.logger.Log("msg", "failed to parse item version", "version", *item[version].N, "err", err) |
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.
What could go wrong if we failed to parse the version? Seems we just log but ignore the error
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.
The version will be set to 0 if we cannot parse the version. This will prevent updates to the DDB entry so there won't be any overwrites that are out of date but the instance won't be able to join the ring. I think that's ok, operators can intervene if that happens.
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.
Maybe for us to track lets add a metric when we get condition check failure error back. It can be a new ddb metric
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.
Good suggestion, updated
Signed-off-by: Anna Tran <trananna@amazon.com>
Signed-off-by: Anna Tran <trananna@amazon.com>
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!
Signed-off-by: Daniel Blando <daniel@blando.com.br>
What this PR does:
Updates the DynamoDB ring client to use versioning in it's KV store entries. Specifically
dynamodbItem
struct which holds the data from the queried item along with a version. If there is no version from DynamoDB for the item, the version defaults to an empty string.Which issue(s) this PR fixes:
Fixes #6986
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]