-
Notifications
You must be signed in to change notification settings - Fork 209
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
Vibhansa/truncate update #1517
base: main
Are you sure you want to change the base?
Vibhansa/truncate update #1517
Conversation
* Preserve block on flush and delete them on close instead.
* Adding proxy from environment fix
* Enabling random write
* adding direct_io data validation test with block cache
* New data test pipeline added
* return error when download fails during overwriting a block
} | ||
return data, err | ||
|
||
return bb.createSparseFile(name, newSize, blockSize, blkList, idLen) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If file size is not aligning with the block size and truncate is used to expand the size, this will lead to irregular blocksizes in the block list.
Eg: lets say blocksize = 4M
file size = 5M (i.e., 2blocks) block1 = 4M, block2 = 1M
Call for truncate(10M)
I suppose the logic in this PR will make the block list look like this after truncate operation:
block1 = 4M, block2 = 1M, block3 = 4M, block4 = 1M.
Although this looks correct but the subsequent operations in block cache cannot utilize this sort of blocklist.
Please correct me if I am wrong
return data, err | ||
} | ||
|
||
func (bb *BlockBlob) createSparseFile(name string, size int64, blockSize int64, blkList []string, idLen int64) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is better to have 2 functions originating from truncate function which are
- Expand
- Shrink
This will make the code more readable imo.
No description provided.