Commit eade3b59ddd95732cbfc635eadf6447c6b3108d2 in branch refs/heads/master from Bill Havanki
[ https://git-wip-us.apache.org/repos/asf?p=accumulo.git;h=eade3b5 ]
ACCUMULO-1948 Tablet constructor no longer leaks this
The core Tablet constructor no longer sets this on the TabletResourceManager passed to it.
The TabletResourceManager instance is created now without a Tablet reference, but only
with its key extent and configuration, and so it can be constructed first and safely passed
to the Tablet constructor. This alteration in TabletResourceManager drove changes to several
other locations which had been expecting a tablet reference to be available. In most of those
places, the key extent takes its place.
However, Keith Turner pointed out that, without a tablet reference in the TabletStateImpl
class (memory report) used to guide minor compaction, it's possible that a report logged
against a tablet that was since unloaded could cause compaction to start on a new instance
of that tablet that had just been reloaded. In order to ensure that cannot happen, the
tablet reference remains, so that the same object is used to decide on compaction and
potentially perform compaction.
In addition, the method of working with the memory reports was changed so that the same
snapshot of them used to decide on compactions is used to find the tablet to compact later.
This change was necessary regardless of this ticket.
Finally, the unused tabletResources field was removed from TabletServerResourceManager,
and that class also now avoids erroneously removing the memory report for a reloaded tablet
if its prior incarnation is unloaded in the scenario described above.