-
Notifications
You must be signed in to change notification settings - Fork 213
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: blobfuse/2.4.1
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 blockList | ||
} | ||
|
||
func (bb *BlockBlob) TruncateFile(name string, size int64) error { | ||
// log.Trace("BlockBlob::TruncateFile : name=%s, size=%d", name, size) |
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.
Can be removed the commented line
data, err := bb.HandleSmallFile(name, size, attr.Size) | ||
if blockSize == 0 { | ||
// Nothing is configured then assume 16MB as default size | ||
blockSize = 16 * 1024 * 1024 |
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.
Is this standard size? if not, we have to document it somewhere.
_ = h.Close() | ||
os.Remove(filename) | ||
|
||
err = suite.az.TruncateFile(internal.TruncateFileOptions{Name: filename, Size: fs.TruncatedSize, BlockSize: 16 * MB}) |
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.
Should we also verify the block size for 1,2 use case after truncate.
@@ -0,0 +1,55 @@ | |||
|
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.
Is this file needed?
No description provided.