-
Notifications
You must be signed in to change notification settings - Fork 312
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
Table transaction batch upsert merge and upsert replace fails with 404 #1232
Comments
Fix appears to be: diff --git a/src/table/persistence/LokiTableMetadataStore.ts b/src/table/persistence/LokiTableMetadataStore.ts
index b0c6c15..027361a 100644
--- a/src/table/persistence/LokiTableMetadataStore.ts
+++ b/src/table/persistence/LokiTableMetadataStore.ts
@@ -295,7 +295,7 @@ export default class LokiTableMetadataStore implements ITableMetadataStore {
ifMatch?: string,
batchID?: string
): Promise<Entity> {
- if (ifMatch === undefined) {
+ if (ifMatch === undefined || ifMatch === "*") {
// Upsert
const existingEntity =
await this.queryTableEntitiesWithPartitionAndRowKey(
@@ -382,7 +382,7 @@ export default class LokiTableMetadataStore implements ITableMetadataStore {
ifMatch?: string,
batchID?: string
): Promise<Entity> {
- if (ifMatch === undefined) {
+ if (ifMatch === undefined || ifMatch === "*") {
// Upsert
const existingEntity =
await this.queryTableEntitiesWithPartitionAndRowKey( |
23 tasks
edwin-huber
added a commit
to edwin-huber/Azurite
that referenced
this issue
Jan 18, 2022
edwin-huber
added a commit
that referenced
this issue
Feb 16, 2022
…ion error handling updated (#1157) * implement preflight table request and add test cases * minor change in package.json and removing obsolete comments * implement batch transaction error handling * working transaction rollback * removed unnecessary commented call to metadatastore endBatchTransaction * updated transaction interface and tests, corrected serial transaction tracking * fixes #1227 by adding the operation index to odata err msg * fixes #1228 by adding the updateTableEntity to transaction rollback * updated batch rollback tests to check etags after update, as noted in #1228 * fixes #1230 * adds wildcard if match to upsert handling addressing #1232 * added if-match check to update and merge handling in batch orchestrator / proxy class * fixes #1233 added if-match check to update and merge handling in batch orchestrator / proxy class * updated replaceEntity test to expect upsert and not fail * renamed replaceEntity test to make test case clear and distinct from others * corrected handling of if-match, batch rollback and updated raw REST test cases * cleaned up some tests after pulling and merging main * modified how we retrieve the account name on a batch request * corrected SAS tests after changes to upsert logic * refactoring table tests to make them easier to follow and resolve some issues with promises * updated test to use arrow functions in LokiTableMetadataStore tests * removed query entites from batch Orchestrator, added Not Implemented error for service parity * added test case for query table entities in batch and modified orchestrator to handle that case * moved BatchId to TableStorageContext * added test to confirm getServiceProperties response for #121 * updated Edm Type Validation for issue #1259 * modified query tokenization regex for additional whitespacing case * added a test to confirm behavior deleting entities with empty partition and row keys * test files renamed for use with npm run table:test + removed comment from handler Co-authored-by: RunyaoFan <44960511+RunyaoFan@users.noreply.github.com>
I have tried the repro on the latest |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which service(blob, file, queue, table) does this issue concern?
table
Which version of the Azurite was used?
Locally running version of #1157
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
Git clone
What's the Node.js version?
16.13.0
What problem was encountered?
When using the upsert-merge table transaction batch action, a 404 is thrown. This should always succeed if the table exists. Note that this operation succeeds perfectly fine outside of a batch.
Steps to reproduce the issue?
Please be sure to remove any PII or sensitive information before sharing!
The debug log will log raw request headers and bodies, so that we can replay these against Azurite using REST and create tests to validate resolution.
Have you found a mitigation/solution?
The text was updated successfully, but these errors were encountered: