Skip to content

Conversation

@halibobo1205
Copy link
Contributor

No description provided.

private void dump() {
if (!isValid.get()) {
logger.info("bloomFilters is not valid.");
return;
Copy link
Contributor

Choose a reason for hiding this comment

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

This may cause the dump() to have a probability of being skipped.

What about waiting for the isValid to be true for a certain time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not very friendly, potentially a long time, like node just starting up as before, cost 15+ s.

Copy link
Contributor

Choose a reason for hiding this comment

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

As I see, isValid is used for sync dump() with flush(), isAlive is used for recovery().

isValid changes from false to true may not take a long time, just waiting for 1 or 2 seconds is enough?

Copy link
Contributor Author

@halibobo1205 halibobo1205 Sep 13, 2023

Choose a reason for hiding this comment

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

There's really no need to think about flush() for kill -15, flush() will always take precedence in here https://github.com/tronprotocol/java-tron/blob/release_v4.7.3/framework/src/main/java/org/tron/common/application/ApplicationImpl.java#L73

@halibobo1205 halibobo1205 added this to the GreatVoyage-v4.7.3 milestone Sep 13, 2023
@halibobo1205 halibobo1205 merged commit 326b782 into tronprotocol:release_v4.7.3 Sep 13, 2023
@halibobo1205 halibobo1205 changed the title fix(db):avoid dumping a wrong cached data fix(db/trans-cache):avoid dumping a wrong cached data Oct 9, 2023
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.

4 participants