Skip to content

Conversation

@giograno
Copy link
Member

@giograno giograno commented Jul 21, 2025

From ~17.07.2025, our LocalStack's only test test_more_than_20_global_secondary_indexes started 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.CreateTableFunction to software.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 ClassRewriter to 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.jar from 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.zip already 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.

@giograno giograno requested a review from viren-nadkarni July 21, 2025 12:36
@giograno giograno marked this pull request as ready for review July 21, 2025 13:28
Copy link
Member

@viren-nadkarni viren-nadkarni left a 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

Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍 reverted previous commit!

Copy link
Member

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.1 file 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.jar
  • dynamodb-local-patch/target/ddb-local-loader-0.2.jar

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry for the misunderstanding :)

@giograno giograno merged commit e4e8c8e into master Jul 21, 2025
@viren-nadkarni viren-nadkarni deleted the ddbv3-patch branch July 22, 2025 06:47
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.

3 participants