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

Remove forced flush of the DB after reconnect #9157

Closed
Tracked by #10812
poulok opened this issue Oct 10, 2023 · 2 comments
Closed
Tracked by #10812

Remove forced flush of the DB after reconnect #9157

poulok opened this issue Oct 10, 2023 · 2 comments

Comments

@poulok
Copy link
Member

poulok commented Oct 10, 2023

When a node reconnects, the database is flushed to disk. This forced flush should be removed so that data that can remain in the in-memory database stays there and the node is not then forced to go to disk when it does not need to.

@anthony-swirldslabs
Copy link
Contributor

There are 3 scenarios for calling saveRecords() that actually writes data to disk, and all of them are reasonable. The first one is caused by copying maps every round, while the second and the third are preformed in the beginning and in the end of the reconnect operation, and they both are necessary to persist the data to disk:

	at com.swirlds.merkledb.MerkleDbDataSource.saveRecords(MerkleDbDataSource.java:513)
	at com.swirlds.virtualmap.datasource.VirtualDataSource.saveRecords(VirtualDataSource.java:90)
	at com.swirlds.virtualmap.internal.merkle.VirtualRootNode.flush(VirtualRootNode.java:1175)
	at com.swirlds.virtualmap.internal.merkle.VirtualRootNode.flush(VirtualRootNode.java:1155)
	at com.swirlds.virtualmap.internal.pipeline.VirtualPipeline.flush(VirtualPipeline.java:511)
	at com.swirlds.virtualmap.internal.pipeline.VirtualPipeline.hashFlushMerge(VirtualPipeline.java:571)
	at com.swirlds.virtualmap.internal.pipeline.VirtualPipeline.doWork(VirtualPipeline.java:589)
	at com.swirlds.merkledb.MerkleDbDataSource.saveRecords(MerkleDbDataSource.java:513)
	at com.swirlds.virtualmap.datasource.VirtualDataSource.saveRecords(VirtualDataSource.java:90)
	at com.swirlds.virtualmap.internal.merkle.VirtualRootNode.flush(VirtualRootNode.java:1175)
	at com.swirlds.virtualmap.internal.merkle.VirtualRootNode.setupWithOriginalNode(VirtualRootNode.java:1420)
	at com.swirlds.common.merkle.synchronization.task.LearnerPushTask.handleCustomRootInitialLesson(LearnerPushTask.java:122)
	at com.swirlds.common.merkle.synchronization.task.LearnerPushTask.extractNodeFromLesson(LearnerPushTask.java:146)
	at com.swirlds.common.merkle.synchronization.task.LearnerPushTask.run(LearnerPushTask.java:247)
	at com.swirlds.common.threading.pool.StandardWorkGroup.lambda$execute$1(StandardWorkGroup.java:142)
	at com.swirlds.merkledb.MerkleDbDataSource.saveRecords(MerkleDbDataSource.java:513)
	at com.swirlds.virtualmap.internal.merkle.AbstractHashListener.flush(AbstractHashListener.java:177)
	at com.swirlds.virtualmap.internal.merkle.AbstractHashListener.onHashingCompleted(AbstractHashListener.java:164)
	at com.swirlds.virtualmap.internal.hash.VirtualHasher.hash(VirtualHasher.java:512)
	at com.swirlds.virtualmap.internal.merkle.VirtualRootNode.lambda$prepareReconnectHashing$4(VirtualRootNode.java:1532)

@anthony-swirldslabs anthony-swirldslabs self-assigned this Apr 11, 2024
@anthony-swirldslabs
Copy link
Contributor

Given the above, there's no extra flushes, and so there's nothing to fix. Closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants