Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

FM-361: Serve snapshot chunks #431

Merged
merged 4 commits into from
Nov 27, 2023
Merged

FM-361: Serve snapshot chunks #431

merged 4 commits into from
Nov 27, 2023

Conversation

aakoshh
Copy link
Contributor

@aakoshh aakoshh commented Nov 14, 2023

Closes consensus-shipyard/ipc#180

Implements the load_snapshot_chunk ABCI method. It looks for the snapshot requested; if it exists it tries to load it from the disk.

Notes

I did not build in any protection against the snapshot not being deleted between the time we find the record in memory and when we try to read it. I don't want to read it inside the STM transaction because that wouldn't guarantee that the pruning task doesn't commit while this one is running, so it's the same from that perspective, but its worse because it can re-read files if the transaction gets retried.

What would solve it if we updated the snapshot item with a timestamp of when it was last requested and did not delete if it was recent, but I'm not sure if it can't be abused.

Another option is to just mark it as being read right now, and update it again to release it when done.

I'm not sure if we tried to read the file while the directory is being deleted, then the delete would leave this and only this file in the directory, and we'd have a partial subnet that would cause problems further down the line. Will have to try.

@aakoshh aakoshh marked this pull request as ready for review November 15, 2023 09:44
@aakoshh aakoshh changed the title FM-361: Server snapshot chunks FM-361: Serve snapshot chunks Nov 15, 2023
@aakoshh aakoshh force-pushed the fm-361-serve-snapshot-chunks branch from 3c1c18c to 14ef420 Compare November 15, 2023 09:48
@aakoshh aakoshh force-pushed the fm-359-remove-old-snapshots branch from db5e5b8 to 1e09bcf Compare November 27, 2023 09:49
Base automatically changed from fm-359-remove-old-snapshots to main November 27, 2023 09:49
@aakoshh aakoshh force-pushed the fm-361-serve-snapshot-chunks branch from 14ef420 to 0b82653 Compare November 27, 2023 09:51
@aakoshh aakoshh merged commit cac5517 into main Nov 27, 2023
1 check failed
@aakoshh aakoshh deleted the fm-361-serve-snapshot-chunks branch November 27, 2023 09:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serve snapshot chunks in ABCI
2 participants