-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fixed idempotency issue by first checking if table does not exist #1035
Fixed idempotency issue by first checking if table does not exist #1035
Conversation
serverless/stacks/AppStack.ts
Outdated
resultCsvUri: "string", | ||
modelPtUri: "string", | ||
onnxUri: "string", | ||
confusionMatrixUri: "string", |
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.
will this code work for if I want to update fields of a dynamo table?
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.
added a question
export async function table_exists(table_name: string) : Promise<boolean> { | ||
const tableNames: string[] = await get_all_tablenames(); | ||
return tableNames.indexOf(table_name) !== -1; | ||
} |
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.
Minor: can you please run Prettier for all changed files? There are some aesthetic issues; for example, each file should end with a blank line.
We'll need to update our checks to also check /serverless in addition to /frontend
@alantao912 can you ask in sst discord best practice for checking if a table exists before creating a new one. ask if sst handles that check sort of under the hood |
|
is there a way we can tag someone who maintains SST in this thread @alantao912 |
globalIndexes: { | ||
"TrainspaceIndex": { partitionKey: "trainspaceId", sortKey: "timestamp"}, | ||
"UserIndex": {partitionKey: "userId"} | ||
}, |
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 if I want to update a GSI or User index. Can we update the PR to be resilient for those cases? @alantao912
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.
I don't think the current approach is correct. I'm looking into other solutions.
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.
added a quick comment @alantao912
SonarCloud Quality Gate failed. 1 Bug No Coverage information Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
@alantao912 status on this? |
Fixed idempotency issue by first checking if table does not exist
Github Issue Number Here: <#1033>
What user problem are we solving?
AppStack.ts does not start because trainspace table already exists.
What solution does this PR provide?
Checks if the table does not already exist before creating it again.
Testing Methodology
Typed dlp-cli serverless start and it worked.
Any other considerations
Issue may have been fixed by something else.