Adar Dembo has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15080 )
Change subject: file cache: evict open fd when descriptor goes out of scope ...................................................................... file cache: evict open fd when descriptor goes out of scope Previously, an open fd remained in cache when its descriptor was destroyed unless the file was marked for deletion. This avoided an extra cache lookup at destruction time and provided faster access to a file if it was closed and then reopened (though that second benefit was irrelevant to the block managers where files were kept open permanently unless they were deleted). With this change, an open fd is forcefully evicted when its descriptor is destroyed. This provides better semantics if the goal is to close a file without deleting it and test that the fd is indeed closed. It also prevents "false positive" cache hits when the user closes the file, renames it, and creates a new file with the old file name. This is an access pattern used by the WAL when a replica fails and it is brought back to life via tablet copy from a healthy server. Change-Id: Iea5317add630753716ef538cc8a198c9b3547822 Reviewed-on: http://gerrit.cloudera.org:8080/15080 Reviewed-by: Andrew Wong <[email protected]> Tested-by: Adar Dembo <[email protected]> --- M src/kudu/util/file_cache-test.cc M src/kudu/util/file_cache.cc M src/kudu/util/file_cache.h 3 files changed, 24 insertions(+), 16 deletions(-) Approvals: Andrew Wong: Looks good to me, approved Adar Dembo: Verified -- To view, visit http://gerrit.cloudera.org:8080/15080 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iea5317add630753716ef538cc8a198c9b3547822 Gerrit-Change-Number: 15080 Gerrit-PatchSet: 2 Gerrit-Owner: Adar Dembo <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120)
