-
Notifications
You must be signed in to change notification settings - Fork 4
Extend patch for Java SDK v2.x #44
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
viren-nadkarni
left a comment
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.
Brilliant work!
For history, this worked fine when we moved from DDBLocal v1 -> v2. This change will support all three major releases of DDBLocal. However already released LS won't gain this update because we used pinned download URLs with commit hash.
cc: @alexrashed
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.
We should bump this up to 0.2
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.
Done in ea60cfe
It slipped to me that the pinned URL had the commit hash. Thanks for pointing this out.
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.
Nit: Let's keep the 0.1 patch to avoid broken links in case very old LS versions did not pin to commit hash.
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.
👍 reverted previous 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.
Sorry, I meant:
- Keep the old
0.1file as is - Create the new build of the patch as
0.2
So that we have two files:
dynamodb-local-patch/target/ddb-local-loader-0.1.jardynamodb-local-patch/target/ddb-local-loader-0.2.jar
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.
Sorry for the misunderstanding :)
This reverts commit ea60cfe.
From ~17.07.2025, our LocalStack's only
test test_more_than_20_global_secondary_indexesstarted to fail.We skipped the test in localstack/localstack#12874.
This was due to the migration of DynamoDB local to the SDK for Java 2.x. (read announcement).
Due to this change, the fully qualified name of the class we are patching changed from
com.amazonaws.services.dynamodbv2.local.shared.access.api.cp.CreateTableFunctiontosoftware.amazon.dynamodb.services.local.shared.access.api.cp.CreateTableFunction.I compared the bytecode of both the old and new versions. I realized that the modification we have in place works for both the old and the new class. Therefore, I modified
ClassRewriterto attempt the transformation on both. This would make the transformation work with 2.x and 3.x versions of DDB Local.Testing
I re-enabled the failing test pointing to the
ddb-local-loader-0.1.jarfrom this branch.Notes
From what I've seen, the DDB Local URL we have in the LocalStack code, i.e.,
https://d1ni2b6xgvw0s0.cloudfront.net/v2.x/dynamodb_local_latest.zipalready points to the new DDB Local version shipped with the Java SDK 2.x.I tried to run the test mentioned above with a DDB Local version using the old SDK (from
https://s3.us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.zip) and I verified that the new agent works retroactively.