-
Notifications
You must be signed in to change notification settings - Fork 197
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
Further optimize blockchain transaction inserts to DB #1354
Conversation
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
…ma validations Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Codecov Report
@@ Coverage Diff @@
## main #1354 +/- ##
========================================
Coverage 99.98% 99.98%
========================================
Files 314 315 +1
Lines 21581 21902 +321
========================================
+ Hits 21577 21898 +321
Misses 2 2
Partials 2 2
|
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
@peterbroadhurst It does look like we have a coverage miss here: https://app.codecov.io/gh/hyperledger/firefly/pull/1354/blob/internal/operations/context.go |
internal/contracts/manager.go
Outdated
if _, ok := err.(*sqlcommon.IdempotencyError); ok { | ||
if op != nil { | ||
// Idempotency key clash but we resubmitted an initialized operation? Return 20x, not 409 | ||
return op, nil | ||
} |
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.
Do we know for sure that this is a resubmitted operation at this point? Or is it possible that we would still hit this in return
in a case where the user re-used an idempotency key and we should have rejected it earlier?
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.
Great question... digging
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.
ok - I've worked through the code, and did find (existing I think in all cases) issues in how the TXID was being propagated, and a weirdness on an interface that returned a single operation even though there might be more.
Commit added e40ec89
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
6bcbb33
to
92d602b
Compare
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
In PR chain with #1343
txwriter
package that depends on bothoperations
andtxcommon
to do batched insertsidempotencyKey
setInsertTransactions
multi-insert function in DB layeridempotencyKey
set TX, by querying those idempotency keysoperations
with a new multi-insert function in the DB layer (these always have new IDs)contracts
package to use ^^^ instead of one-by-one insertion of tx+opsRunAsGroup
call removed)core.Operation
moved up the function, as need to be passed incontracts
packagemethodPath
->FFIMethod
+[]*FFIError