-
Notifications
You must be signed in to change notification settings - Fork 59
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
transaction rewrite, increase pg connection timeout #1525
Conversation
587bdf3
to
29a6099
Compare
@InoMurko Where you able to try this out with a 64k transactions block? Where would be the best place for us to introduce a test like this to ensure we don't break it in the future? |
My testing locally was with 50k transactions. Let me just reiterate that this PR doesn't introduce any performance increases. |
@InoMurko understood, but you did introduce a bigger timeout, which appears to solve the issue with 50k transactions, right? That's good, but not the maximum we can have in a block so we probably need to test with a bit more 🙇 . And I still would like to see those changes documented in a test ran somewhere in the pipeline. cc @kevsul |
Explaining the test in SQL terms:
Transactions and outputs that "came out of that block". These are being chunked into equal parts. Where a single part has at most 0xFFFF items: Transactions:
same stuff, but for txoutputs
the last thing is to mark all existing inputs as spent, in this test case, its 64k updates, but the table is empty:
and so on and so on... |
A limited amount of transactions in a block:
|
Now I believe that the test example is completely false, I think its creating inputs out of thin air. A full block could be a perf test. cc @achiurizo @T-Dnzt |
The Postgres version we're using in GCS is 9.6.
All three primary keys are being search for in the UPDATE.
Could it be that extra references are slowing down the updates?
|
] | ||
) | ||
db_txs_stream = Chunk.chunk(db_txs) | ||
db_outputs_stream = Chunk.chunk(db_outputs) |
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.
Lots of Chunk.chunk(chunk)
|
||
result | ||
|
||
{:error, changeset} -> | ||
_ = Logger.debug("Block \##{block_number} not persisted in WatcherDB, done in #{insert_duration / 1000}ms") | ||
{:error, name, changeset, explain} -> |
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.
d2caa3e
to
0de38b3
Compare
#1378 (comment)
Overview
Rewritten the transaction into ectomulti.
Changes
Describe your changes and implementation choices. More details make PRs easier to review.
Testing
mix test
Table description: