helifu has posted comments on this change. ( http://gerrit.cloudera.org:8080/13426 )
Change subject: KUDU-2797: the master aggregates tablet statistics ...................................................................... Patch Set 15: (5 comments) http://gerrit.cloudera.org:8080/#/c/13426/15//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/13426/15//COMMIT_MSG@12 PS15, Line 12: In this patch, tablet statistics including disk size and live row : counts of all the replicas are aggregated on the master and only : the leader ones are summed up and displayed on the 'TablePage'. : At the same time, every replica's statistics are displayed on the : 'TabletPage'. > Could you also add the detail that these are also exposed as metrics on the Done http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/integration-tests/ts_tablet_manager-itest.cc File src/kudu/integration-tests/ts_tablet_manager-itest.cc: http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/integration-tests/ts_tablet_manager-itest.cc@632 PS15, Line 632: while (true) { : NO_FATALS(TriggerHeartbeat()); : ASSERT_EQ(0, table_info->metrics()->live_row_count->value()); : if (table_info->metrics()->on_disk_size->value() > 0) { : break; : } : } > nit: if you use ASSERT_EVENTUALLY, it will do some back-off for you. E.g. Done http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/master/master_stats.cc File src/kudu/master/master_stats.cc: PS15: > This has more to do with "metrics" than it does "stats". How about calling Done http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/tablet/tablet_replica.cc File src/kudu/tablet/tablet_replica.cc: http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/tablet/tablet_replica.cc@845 PS15, Line 845: const ReportedTabletStatsPB& TabletReplica::stats_pb() const { : return stats_pb_; : } > On second thought, I think for more obvious thread-safety, this should inde 1.API: done. 2.Move the lock: maybe it's not appropriate. http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/tserver/ts_tablet_manager.cc File src/kudu/tserver/ts_tablet_manager.cc: http://gerrit.cloudera.org:8080/#/c/13426/15/src/kudu/tserver/ts_tablet_manager.cc@1308 PS15, Line 1308: lock_stats_.lock_shared(); : ReportedTabletStatsPB stats_pb = replica->stats_pb(); : lock_stats_.unlock_shared(); > The fact that we're taking a lock just for this makes me think the locking The 'lock_stats_' is both used by writing(update stats by heartbeat thread) and reading. And I think it's not appropriate to put it into the TabletReplica. What do you think? -- To view, visit http://gerrit.cloudera.org:8080/13426 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I74406ab7cca7c22fda455c328b8ee9989a6b2d99 Gerrit-Change-Number: 13426 Gerrit-PatchSet: 15 Gerrit-Owner: helifu <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Mike Percy <[email protected]> Gerrit-Reviewer: helifu <[email protected]> Gerrit-Comment-Date: Tue, 25 Jun 2019 03:06:50 +0000 Gerrit-HasComments: Yes
