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

Fix a bug causing sync to create many tiny chunks. #253

Merged
merged 3 commits into from
Feb 16, 2022

Conversation

christian-oudard
Copy link
Contributor

  1. Start full-service with an empty ledger and an empty wallet db
  2. Import an account from entropy, giving it a first_block of 0
  3. The ledger sync process will enter one block at a time into the
    ledger DB. The account sync process will then attempt to decode
    transactions from these blocks in very small chunks, of size 5-10
    (instead of ten thousand), with no sleeping in between. Furthermore, the
    first account will do all of the syncing, not letting any other accounts
    sync at the same time.

In order to fix this, the condition for reporting whether the sync
thread can pause was updated to more elegantly handle this condition, by
counting the number of blocks synced, and comparing it to the ideal
chunk size.

1) Start full-service with an empty ledger and an empty wallet db
2) Import an account from entropy, giving it a first_block of 0
3) The ledger sync process will enter one block at a time into the
ledger DB. The account sync process will then attempt to decode
transactions from these blocks in very small chunks, of size 5-10
(instead of ten thousand), with no sleeping in between. Furthermore, the
first account will do all of the syncing, not letting any other accounts
sync at the same time.

In order to fix this, the condition for reporting whether the sync
thread can pause was updated to more elegantly handle this condition, by
counting the number of blocks synced, and comparing it to the ideal
chunk size.
@briancorbin briancorbin merged commit d75226f into develop Feb 16, 2022
@briancorbin briancorbin deleted the bugfix/ledger-db-sync-tiny-chunks branch February 16, 2022 19:42
briancorbin added a commit that referenced this pull request Mar 4, 2022
* adding max limit to some API endpoints (#248)

* Remove unnecessary foreign keys from gift_codes table. (#249)

* Update readme installation instructions (#250)

* Enable foreign key constraints. Fix transient FK errors when deleting an account. (#251)

* Remove foreign key check before running migrations. This allows databases with existing foreign key errors to be fixed by the migrations. (#252)

* Fix a bug causing sync to create many tiny chunks. (#253)

* Remove target block arg from manually sync account fn (#255)

* Initial action to build containers for tag pushes (#256)

* Supporting FOG enabled accounts (#254)

* FOG Creds default to empty string if not provided from API (#257)

* update readme (#259)

* Api key guard (#205)

* fixing issue with ledger not syncing automatically (#261)

* sync up to the last block instead of excluding it (#262)
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

Successfully merging this pull request may close these issues.

2 participants