[kudu-CR] file cache: evict open fd when descriptor goes out of scope
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 Tested-by: Adar Dembo --- 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 Gerrit-Reviewer: Adar Dembo Gerrit-Reviewer: Alexey Serbin Gerrit-Reviewer: Andrew Wong Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] file cache: evict open fd when descriptor goes out of scope
Adar Dembo has removed a vote on this change. Change subject: file cache: evict open fd when descriptor goes out of scope .. Removed Verified-1 by Kudu Jenkins (120) -- 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: deleteVote Gerrit-Change-Id: Iea5317add630753716ef538cc8a198c9b3547822 Gerrit-Change-Number: 15080 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo Gerrit-Reviewer: Adar Dembo Gerrit-Reviewer: Alexey Serbin Gerrit-Reviewer: Andrew Wong Gerrit-Reviewer: Kudu Jenkins (120)
[kudu-CR] file cache: evict open fd when descriptor goes out of scope
Adar Dembo has posted comments on this change. ( http://gerrit.cloudera.org:8080/15080 ) Change subject: file cache: evict open fd when descriptor goes out of scope .. Patch Set 1: Verified+1 Overriding Jenkins, unrelated test failure. -- 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: comment Gerrit-Change-Id: Iea5317add630753716ef538cc8a198c9b3547822 Gerrit-Change-Number: 15080 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo Gerrit-Reviewer: Adar Dembo Gerrit-Reviewer: Alexey Serbin Gerrit-Reviewer: Andrew Wong Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Tue, 21 Jan 2020 22:40:43 + Gerrit-HasComments: No
[kudu-CR] file cache: evict open fd when descriptor goes out of scope
Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/15080 ) Change subject: file cache: evict open fd when descriptor goes out of scope .. Patch Set 1: Code-Review+2 -- 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: comment Gerrit-Change-Id: Iea5317add630753716ef538cc8a198c9b3547822 Gerrit-Change-Number: 15080 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo Gerrit-Reviewer: Alexey Serbin Gerrit-Reviewer: Andrew Wong Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Comment-Date: Tue, 21 Jan 2020 20:15:32 + Gerrit-HasComments: No
[kudu-CR] file cache: evict open fd when descriptor goes out of scope
Hello Alexey Serbin, Andrew Wong, I'd like you to do a code review. Please visit http://gerrit.cloudera.org:8080/15080 to review the following change. 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 --- 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(-) git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/80/15080/1 -- 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: newchange Gerrit-Change-Id: Iea5317add630753716ef538cc8a198c9b3547822 Gerrit-Change-Number: 15080 Gerrit-PatchSet: 1 Gerrit-Owner: Adar Dembo Gerrit-Reviewer: Alexey Serbin Gerrit-Reviewer: Andrew Wong