Will Berkeley has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/7981 )
Change subject: KUDU-2044 Tombstoned tablets show up in /metrics ...................................................................... KUDU-2044 Tombstoned tablets show up in /metrics This patch stops tombstoned tablets from showing up in /metrics. When a tablet replica is shut down, the tablet's metric entity is marked as unpublished. All its child metrics will be marked for retirement, then retired after the retirement interval has passed. Then the entity itself is unregistered, i.e. removed from the metric registry's map of entities. If a new replica of the same tablet is added to the server, it will create a new entity that will be registered with the metric_registry, either as a new insertion or overwriting the old replica's entity if the entity had been unpublished but not yet unregistered. The tombstoned tablet's metric entity is not destroyed when it's deregistered, since there are still refs to it and its metrics in the TabletReplica class, Tablet class, and many other classes associated with a TabletReplica. The entity will be destroyed when the TabletReplica is deleted (since it either contains or holds final references to all the other classes), which happens if the tablet is replaced or deleted. While it's not ideal to hold the memory for the entity when it's no longer used, the reason this occurs is because the TabletReplica instance mostly stays alive. Releasing all the metric references would require specifically dropping refs to those metrics in all the surviving subcomponents of a TabletReplica instance that has been shut down; I think this problem would be better solved by more completely cleaning up a shut down TabletReplica instance, but that's a much larger scope than suppressing the metrics. Change-Id: I21b52262203410ded1e514502b59a79be12f8fb3 Reviewed-on: http://gerrit.cloudera.org:8080/7981 Tested-by: Kudu Jenkins Reviewed-by: David Ribeiro Alves <[email protected]> --- M src/kudu/integration-tests/tablet_copy-itest.cc M src/kudu/tablet/tablet.cc M src/kudu/tserver/tablet_server-test.cc M src/kudu/util/metrics.cc M src/kudu/util/metrics.h 5 files changed, 146 insertions(+), 11 deletions(-) Approvals: Kudu Jenkins: Verified David Ribeiro Alves: Looks good to me, approved -- To view, visit http://gerrit.cloudera.org:8080/7981 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: I21b52262203410ded1e514502b59a79be12f8fb3 Gerrit-Change-Number: 7981 Gerrit-PatchSet: 8 Gerrit-Owner: Will Berkeley <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: David Ribeiro Alves <[email protected]> Gerrit-Reviewer: Kudu Jenkins Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: Tidy Bot Gerrit-Reviewer: Will Berkeley <[email protected]>
