Skip to content
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

[Debug] DynamoDB #633

Merged
merged 7 commits into from Aug 23, 2020
Merged

[Debug] DynamoDB #633

merged 7 commits into from Aug 23, 2020

Conversation

joowon-byun
Copy link
Contributor

@joowon-byun joowon-byun commented Aug 20, 2020

Proposed changes

  • Change dynamoDB client creation position.
  • Fix correct name of DynamoDB.
    • Single dynamoDB table name : klaytn-default-misc (always had -misc postfix) -> klaytn-default
    • Non-single S3 bucket : klaytn-default -> klaytn-default-misc, klaytn-default-header, ...
  • Make crit on unrecoverable batch write requests.

Types of changes

Please put an x in the boxes related to your change.

  • Bugfix
  • New feature or enhancement
  • Others

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING GUIDELINES doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

Further comments

@@ -406,6 +409,10 @@ func createBatchWriteWorker(writeCh <-chan *batchWriteWorkerInput) {
numUnprocessed := len(BatchWriteItemOutput.UnprocessedItems[batchInput.tableName])
for err != nil || numUnprocessed != 0 {
if err != nil {
if strings.Contains(err.Error(), "ValidationException") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this error happen?

  • If we remove the dynamoDB table, it can be happen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It happens when there is a input errror such as duplicated input in batch, 0 or more than 25 items in batch, empty input in item and so on.
When we remove teh dynamoDB table, ResourceNotFoundException will occur. But this error can also occur when the table is being created or archived. I don't think it is a good idea to crit on ResourceNotFoundException because it can be solved when time passes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is duplicated input? Is it same key/value item with another one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if there are two items with the same key, it is an error.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I got it your intention.
Please write some comments about the case of the error and why this crit is needed.

Copy link
Contributor

@KimKyungup KimKyungup left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. but please add some comment about the crit.

aidan-kwon
aidan-kwon previously approved these changes Aug 21, 2020
@joowon-byun joowon-byun merged commit a171e6e into klaytn:dev Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants