-
Notifications
You must be signed in to change notification settings - Fork 7
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
fix(egress-tracking): new partition and sort key for dynamo table #443
Conversation
@@ -5,7 +5,7 @@ | |||
"packageManager": "[email protected]+sha256.c8c61ba0fa0ab3b5120efd5ba97fdaf0e0b495eef647a97c4413919eda0a878b", | |||
"type": "module", | |||
"scripts": { | |||
"start": "sst start", | |||
"start": "sst dev", |
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 sst start
command is deprecated.
View stack outputs
|
Added the `nonce` as suggested per @alanshaw, but also set it to not expire, so we can process the invocation any time. The `servedAt` field doesn't need to be converted to seconds. Blocked by storacha/w3infra#443 & storacha/w3up#1588
@@ -191,7 +191,7 @@ export const createEgressTrafficTestContext = async () => { | |||
}) | |||
} | |||
|
|||
const egressTrafficTable = await createTable(awsServices.dynamo.client, egressTrafficTableProps, 'egress-traffic-') | |||
const egressTrafficTable = await createTable(awsServices.dynamo.client, egressTrafficTableProps, 'egress-traffic-events-') |
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.
Why dash suffix?
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.
This is how tables and queue names are defined in the test context. Then it adds some random value at the end for each time you execute the tests.
Context
I've identified an issue in our DynamoDB table where egress events were not being stored correctly. This was traced back to the configuration of our partition key (PK) and sort key (SK). In DynamoDB, the partition key is crucial for uniquely identifying each item, while the sort key helps organize data within a partition.
This change ensures that the combination of partition key and sort key is unique for each record, preventing DynamoDB from overriding existing records in case of a collision.
Changes Made
Modification of Partition Key (PK) & Sort Key (SK):
Inclusion of
cause
in Stripe Idempotent Key:cause
as part of the Stripe idempotent key to ensure the uniqueness of requests to Stripe, preventing duplicate processing.Renaming of Table from
egress-traffic
toegress-traffic-events
:Impact
Blocked by storacha/w3up#1588