Repository navigation
fix(blob): give copied blobs their own page ranges and committed blocks - #2894
Open
compiler-segfault (compiler-segfault) wants to merge 1 commit into
Open
compiler-segfault (compiler-segfault) wants to merge 1 commit into
compiler-segfault (compiler-segfault) wants to merge 1 commit into
Conversation
Copy Blob handed the source's pageRangesInOrder and committedBlocksInOrder arrays to the new blob. Both are mutated in place, so writing to a copy, or to a blob restored from a snapshot, also changed what the source blob or the snapshot read back. Clone both lists when the destination blob is created, as cloneBlobModel already does.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
startCopyFromURLandcopyFromURLinLokiBlobMetadataStorehand the newblob the source's
pageRangesInOrderandcommittedBlocksInOrderarraysinstead of copies of them. Both arrays are mutated in place:
uploadPages,clearRangeandresizePageBlobrewrite the page range list, andappendBlockpushes to the committed block list. The source and the copy endup sharing one list, so:
source reads back, and the source's ETag does not change.
blob changes what the snapshot reads back, so a backup is overwritten by the
next write after a restore.
source as well, and the source's own next block is not visible.
Clone both lists when the destination blob is created, using the same shape
cloneBlobModelalready uses, and reuse those helpers there. The chunksthemselves stay shared copy-on-write; only the lists that are mutated in place
are copied. The SQL metadata store is not affected, since it deserializes each
blob separately.
Three regression tests cover the page blob copy, the snapshot restore and the
append blob copy. All three fail on
mainand pass with the change.pageblob.test.tsandappendblob.test.tspass in full (100 passing, 1pending), and
eslintis clean.Fixes #2890.