forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TieredStorage] Make TieredStorage::write_accounts() thread-safe (sol…
…ana-labs#35143) #### Problem While accounts-db might not invoke appends_account twice for the same AccountsFile, TieredStorage::write_accounts() itself isn't thread-safe, and it depends on the above accounts-db assumption. #### Summary of Changes This PR makes TieredStorage::write_accounts() thread-safe. So only the first thread that successfully updates the already_written flag can proceed and write the input accounts. All subsequent calls to write_accounts() will be a no-op and return AttemptToUpdateReadOnly Error.
- Loading branch information
1 parent
e406402
commit 6934589
Showing
1 changed file
with
23 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters