Zoltan Martonka has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/20680 )

Change subject: KUDU-3523 Use f_bsize as Kudu block size instead of st_blksize
......................................................................


Patch Set 4:

I looked into LogBlockManagerTest/ContainerPreallocationTest on our cloudera 
rhel (Xixu probably has a similar setup). 64k kernel with 4k disk.
The following happens:
+ The encryption header is written without preallocating 
FLAGS_log_container_preallocate_bytes bytes.

+ When we try to write some data, kudu round up the current byte size to 64k 
and tries to allocate the next block from there until 
FLAGS_log_container_preallocate_bytes bytes. But it should round to 4k, because 
f_bsize is 4k and it is the one that allocate/hole punch uses.
Since FLAGS_log_container_preallocate_bytes=33554432, Kudu expects to have 512 
64k continuous block reserved. Instead it will have a 4k block, then 15*4k 
holes, and then 16*512 4k block reserved again. It is clearly kudu wrong and 
not the system api.

If you wish to debug it yourself and make your own conclusion I would suggest:
+ on log_block_manager-test.cc line remove the false from 
INSTANTIATE_TEST_SUITE_P(...)
+ put a breakpoint in log_block_manager.cc line 1635: 
RETURN_NOT_OK_HANDLE_ERROR(data_file_->PreAllocate(off, len, 
RWFile::CHANGE_FILE_SIZE));
+ Run ContainerPreallocationTest. When it stops in the breakpoint, you can 
check that the file is only 4k, and it tries to allocate after 64k.


--
To view, visit http://gerrit.cloudera.org:8080/20680
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I04343caf5fe377a4fa9b57e6e450307e6b995928
Gerrit-Change-Number: 20680
Gerrit-PatchSet: 4
Gerrit-Owner: Wang Xixu <1450306...@qq.com>
Gerrit-Reviewer: Alexey Serbin <ale...@apache.org>
Gerrit-Reviewer: Ashwani Raina <ara...@cloudera.com>
Gerrit-Reviewer: Attila Bukor <abu...@apache.org>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Reviewer: Wang Xixu <1450306...@qq.com>
Gerrit-Reviewer: Yifan Zhang <chinazhangyi...@163.com>
Gerrit-Reviewer: Yingchun Lai <laiyingc...@apache.org>
Gerrit-Reviewer: Zoltan Martonka <zmarto...@cloudera.com>
Gerrit-Comment-Date: Thu, 14 Dec 2023 14:19:59 +0000
Gerrit-HasComments: No

Reply via email to