Hello Tidy Bot, Kudu Jenkins, Adar Dembo,
I'd like you to reexamine a change. Please visit
http://gerrit.cloudera.org:8080/8276
to look at the new patch set (#4).
Change subject: once: report init_succeeded instead of initted
......................................................................
once: report init_succeeded instead of initted
We use KuduOnceDynamic to lazily open various objects, ensuring various
initializations happen once and only once. By design, after the first
call to its member function, further calls to Init() will no-op, and the
KuduOnceDynamic will report that it has been initted. This can be
problematic if the function fails, as in a few places, we condition on
this initted state, assuming "initted" means "init succeeded".
This patch changes KuduOnceDynamic's API to report whether the init
succeeded, still maintaining the property that the function is run once.
One codepath that is particularly vulnerable to this is the InitOnce of
DeltaFileReader, which reads some stats from disk into memory, and can
go un-initialized until scan-time. Before, if a deltafile were corrupted
and scanned, the scan would return with an error upon initializing the
DeltaFileReader (which would at that point be considered "initted"). If
it were scanned a second time, seeing that it had been initted, the
DeltaFileReader would attempt to access the in-memory stats and hit a
nullptr error. A test is added to tablet_server-test to demonstrate
that this fails reliably.
Change-Id: I7ac7131144392d673e0a72a1ba9920bcf9fd991c
---
M src/kudu/cfile/bloomfile.cc
M src/kudu/cfile/cfile-test.cc
M src/kudu/cfile/cfile_reader.cc
M src/kudu/cfile/cfile_reader.h
M src/kudu/fs/fs-test-util.h
M src/kudu/tablet/deltafile.cc
M src/kudu/tablet/deltafile.h
M src/kudu/tserver/tablet_copy_source_session.cc
M src/kudu/tserver/tablet_copy_source_session.h
M src/kudu/tserver/tablet_server-test.cc
M src/kudu/util/once-test.cc
M src/kudu/util/once.h
12 files changed, 138 insertions(+), 53 deletions(-)
git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/76/8276/4
--
To view, visit http://gerrit.cloudera.org:8080/8276
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I7ac7131144392d673e0a72a1ba9920bcf9fd991c
Gerrit-Change-Number: 8276
Gerrit-PatchSet: 4
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Adar Dembo <[email protected]>
Gerrit-Reviewer: Andrew Wong <[email protected]>
Gerrit-Reviewer: Kudu Jenkins
Gerrit-Reviewer: Tidy Bot