Handle generation and digests.
Whenever certain record is written generation and its digest are stored in metadata file, and then all previous metadata file(s) are asynchronously deleted. When reopening the StorageQueue, metadata file matching the last sequencing number is used to restore generation and digest for future writes. The code does not handle errors yet - missing or corrupt metadata file, incomplete data file, etc. In the future we will add code to reset generation id and eliminate last digest. MockClient in tests makes sure generation_id is the same for all records. It also verify records own digest; last record digest is not verified yet, because the test expects some records to be duplicated. Bug: b:153364303 Bug: b:153659559 Change-Id: I80d8e7f03097bcc4a510f21e0a546876b3104960 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388716 Commit-Queue: Leonid Baraz <lbaraz@chromium.org> Reviewed-by:Zach Trudo <zatrudo@google.com> Cr-Commit-Position: refs/heads/master@{#804486}
Showing
Please register or sign in to comment