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(db/trans-cache):avoid dumping a wrong cached data #5491

Conversation

halibobo1205
Copy link
Contributor

No description provided.

@@ -318,6 +318,7 @@ private boolean handleException(Throwable e) {
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
5 checks passed
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants