-
Notifications
You must be signed in to change notification settings - Fork 155
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
400 Arango error on inserting to executionPlan #1300
Comments
Oh, there must be a really high concurrency if that happens :)
No, the Try to play with it and when it works, create a pull-request please. private nextTxNumber(): TxNum {
let attempts: number = 10 // Max attempts to atomically increment the counter
while (attempts-- > 0) {
try {
const curCnt: Counter = store.getDocByKey(CollectionName.Counter, 'tx')
// as of time of writing the '@types/arangodb:3.5.13' was the latest version,
// and it was not up-to-date with ArangoDB 3.10+ JavaScript API
// @ts-ignore
const updResult: UpdateResult<Counter> = db._update(
curCnt,
{
curVal: curCnt.curVal + 1
},
// @ts-ignore
{
overwrite: false, // check _rev
returnNew: true // return an updated document in the `new` attribute
}
)
const newCnt: Counter = updResult.new
return newCnt.curVal
}
catch (e) {
if (e['errorNum'] !== 1200) throw e
}
}
} |
Discussed in #1299
Originally posted by vishalag001 January 25, 2024
Hi @wajda ,
I am getting the following error on inserting to executionPlan. Looks like the transaction is unable to update the counter to _rev attribute mismatch. There are too many inserts happening parallely. Can we ignore the _rev match validation while updating or is there anything else that I am missing ? How to resolve this issue?
Appreciate your help and guidance. Thanks in advance !
The text was updated successfully, but these errors were encountered: