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: adjust flush condition to avoid not flush #114

Merged
merged 1 commit into from
May 24, 2024

Conversation

will-2012
Copy link
Contributor

@will-2012 will-2012 commented May 23, 2024

Description

Adjust the flush condition to avoid the small probability of not flushing.

Rationale

The diff to base condition:

commitFunc := func(buffer *multiDifflayer) bool {
if nf.base.size >= nf.base.limit {
log.Debug("base node buffer need write disk immediately")
return false
}

and the background base flush condition:

if nf.base.size > nf.base.limit {
nf.backgroundFlush()
}

should be consistent.

Example

N/A.

Changes

Notable changes:

  • bufferlist.

@github-actions github-actions bot requested review from krish-nr and redhdx May 23, 2024 11:00
@will-2012 will-2012 force-pushed the fix-bufferlist branch 2 times, most recently from e959def to dadf900 Compare May 23, 2024 12:15
@will-2012 will-2012 changed the title fix: flush base buffer at startup fix: adjust flush condition to avoid not flush May 23, 2024
@will-2012 will-2012 marked this pull request as draft May 23, 2024 12:20
@will-2012 will-2012 marked this pull request as ready for review May 23, 2024 12:37
@will-2012 will-2012 added the R4R Ready for review label May 23, 2024
@github-actions github-actions bot requested review from owen-reorg and welkin22 May 23, 2024 12:37
@joeylichang
Copy link
Contributor

LGTM

Copy link
Contributor

@krish-nr krish-nr left a comment

Choose a reason for hiding this comment

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

LGTM

@krish-nr krish-nr merged commit f9643c4 into bnb-chain:develop May 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
R4R Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants