Skip to content
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

[Feature request] Honor total order for concurrent processing threads #189

Open
alnoki opened this issue Nov 13, 2023 · 0 comments
Open

Comments

@alnoki
Copy link

alnoki commented Nov 13, 2023

Presently, processor insertions are nondeterministic when concurrent processing tasks are enabled, such that the processor must be pinned to single-threading to enforce total ordering of transactions.

In practice, this slows down processing, in particular doubling or even tripling the time to sync to chain tip, for example with the Econia Data Service Stack (https://econia.dev/off-chain/dss/data-service-stack).

Offline notes and suggestions:

@banool

@larry-aptos, perhaps we could devise some kind of multi worker sequential execution scheme.

@bowenyang007

One relatively simple implementation is to allow for a reduce. Currently we create multiple threads (map) and these directly write to the db, but if we actually could compute the results of the threads and run through a reduce against data already in the db we could achieve ordering.

Myself

  • Cache insertions in a postgres table and only insert to main tables once colliding threads are complete
  • Execute each insertion as a subtransaction of an overall postgres transaction, comitting once colliding threads are complete

cc @CRBl69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant