Zoltan Martonka has posted comments on this change. ( http://gerrit.cloudera.org:8080/20894 )
Change subject: Fix CheckHolePunch for bigger than 4k blocks. ...................................................................... Patch Set 5: (1 comment) http://gerrit.cloudera.org:8080/#/c/20894/2/src/kudu/fs/dir_util.cc File src/kudu/fs/dir_util.cc: http://gerrit.cloudera.org:8080/#/c/20894/2/src/kudu/fs/dir_util.cc@a68 PS2, Line 68: > Maybe I am missing something here. PreAllocate always calls allocate, you are right. If you call it with non-whole blocks it just rounds up the reservation. If you allocate 16k it will take a whole 64k block. If you would allocate 80k, it would take up 128k. If you holepunch a non-aligned interval, it will zero the bits out, but only free up blocks that are entirely in the interval. (e.g if you holepunch from [2k,10k] on a 4k filesystem, it will only free up the 2nd block. it will zero out the second half of the 1st block and the first half of the 3rd block). If you do multiple holepunches, that overlap, it won't free up blocks that are shared between. (e.g on a 4k filesystem you holepunch [2k, 6k] [6k, 10k], then the 2nd block (4k to 8k)will still be reserved by the file. Here is an easy to run c++ example (for xfs): https://github.com/martonka/kudu_random_stuff/blob/master/cpp/hole_punch_test.cpp -- To view, visit http://gerrit.cloudera.org:8080/20894 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: Ib4af73f0aa25db674fe0a34355cecd27a0c68417 Gerrit-Change-Number: 20894 Gerrit-PatchSet: 5 Gerrit-Owner: Zoltan Martonka <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Ashwani Raina <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Wang Xixu <[email protected]> Gerrit-Reviewer: Zoltan Martonka <[email protected]> Gerrit-Comment-Date: Fri, 19 Jan 2024 13:31:29 +0000 Gerrit-HasComments: Yes
