Andrew Wong has posted comments on this change. ( http://gerrit.cloudera.org:8080/17725 )
Change subject: KUDU-3204: Add a metric for amount of available space ...................................................................... Patch Set 4: (10 comments) I started reviewing this file, but realized there were some comments left unaddressed, so maybe this isn't ready for a re-review? In either case, I'll leave the comments I had this time around. http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/consensus/log.cc File src/kudu/consensus/log.cc: http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/consensus/log.cc@148 PS4, Line 148: DECLARE_int64(fs_data_dirs_reserved_bytes); We shouldn't need to declare this here since it's not used in this file. http://gerrit.cloudera.org:8080/#/c/17725/3/src/kudu/fs/fs_manager.cc File src/kudu/fs/fs_manager.cc: http://gerrit.cloudera.org:8080/#/c/17725/3/src/kudu/fs/fs_manager.cc@101 PS3, Line 101: DEFINE_int64(fs_wal_dir_reserved_bytes, -1, > That's done already. The definition is removed from consensus/log.cc Ah oops, missed that somehow. http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc File src/kudu/server/server_base.cc: http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@259 PS4, Line 259: wal nit: WAL. Same elsewhere http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@266 PS4, Line 266: "Total space available in all the data directories", We should also mention the error behavior that this returns -1 http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@431 PS4, Line 431: // Calculates the free space on the WAL disk. nit: could you also document the error semantics? Same with the other method. http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@432 PS4, Line 432: int64_t nit: this doesn't need to have a return value if values are being returned via output parameters. http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@434 PS4, Line 434: waldir_space_last_check nit: we should keep the naming of our variables standardized as separating words with underscores. I.e. change this to "wal_dir_space_last_check_". Same elsewhere, and with "datadir" --> "data_dir" http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@434 PS4, Line 434: MonoTime& waldir_space_last_check, : int64_t& wal_dir_available_space nit: parameters that are output values (even if they're also input values) tend to be pointers, not references. I.e. this should be MonoTime* and int64_t* http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@443 PS4, Line 443: wal_dir_available_space = -1; : return wal_dir_available_space; As a user, I'm curious if it would make sense to leave the value as is on failure. I.e. if there's a failed disk, would it make sense to just not update the value, rather than using a magic number? http://gerrit.cloudera.org:8080/#/c/17725/4/src/kudu/server/server_base.cc@447 PS4, Line 447: reserved_bytes = (should_reserve_one_percent == TRUE) ? > warning: result of comparison of constant 'RLE' (4) with expression of type should_preserve_one_percent is already a boolean. You don't need further comparison against true/false -- To view, visit http://gerrit.cloudera.org:8080/17725 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I58a7419847d080498aaf431d1dab098e1af71ad0 Gerrit-Change-Number: 17725 Gerrit-PatchSet: 4 Gerrit-Owner: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Mon, 02 Aug 2021 17:37:20 +0000 Gerrit-HasComments: Yes
