Skip to content

core/rawdb: change the mechanism to schedule freezer sync#32135

Merged
rjl493456442 merged 3 commits intoethereum:masterfrom
rjl493456442:optimize-freezer-flush
Jul 15, 2025
Merged

core/rawdb: change the mechanism to schedule freezer sync#32135
rjl493456442 merged 3 commits intoethereum:masterfrom
rjl493456442:optimize-freezer-flush

Conversation

@rjl493456442
Copy link
Copy Markdown
Member

This pull request slightly improves the freezer fsync mechanism by scheduling the
Sync operation based on the number of uncommitted items and original time interval.

Originally, freezer.Sync was triggered every 30 seconds, which worked well during
active chain synchronization. However, once the initial state sync is complete, the
fixed interval causes Sync to be scheduled too frequently.

To address this, the scheduling logic has been improved to consider both the time
interval and the number of uncommitted items. This additional condition helps avoid
unnecessary Sync operations when the chain is idle.

@rjl493456442 rjl493456442 added this to the 1.16.2 milestone Jul 7, 2025
Comment thread core/rawdb/freezer_table.go Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uncommit uint64 // Count of items written without flushing to file
uncommitted uint64 // Count of items written without flushing to file

Copy link
Copy Markdown
Member

@MariusVanDerWijden MariusVanDerWijden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

@rjl493456442 rjl493456442 merged commit 7364e63 into ethereum:master Jul 15, 2025
4 of 5 checks passed
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 2025
…2135)

This pull request slightly improves the freezer fsync mechanism by scheduling 
the Sync operation based on the number of uncommitted items and original
time interval.

Originally, freezer.Sync was triggered every 30 seconds, which worked well during
active chain synchronization. However, once the initial state sync is complete, 
the fixed interval causes Sync to be scheduled too frequently.

To address this, the scheduling logic has been improved to consider both the time 
interval and the number of uncommitted items. This additional condition helps 
avoid unnecessary Sync operations when the chain is idle.
gballet pushed a commit to gballet/go-ethereum that referenced this pull request Sep 11, 2025
…2135)

This pull request slightly improves the freezer fsync mechanism by scheduling 
the Sync operation based on the number of uncommitted items and original
time interval.

Originally, freezer.Sync was triggered every 30 seconds, which worked well during
active chain synchronization. However, once the initial state sync is complete, 
the fixed interval causes Sync to be scheduled too frequently.

To address this, the scheduling logic has been improved to consider both the time 
interval and the number of uncommitted items. This additional condition helps 
avoid unnecessary Sync operations when the chain is idle.
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