Alexey Serbin 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 2: (12 comments) http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/CMakeLists.txt File src/kudu/server/CMakeLists.txt: http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/CMakeLists.txt@62 PS2, Line 62: consensus I'm not sure I understand why this is now required here: server_process is supposed to be free of consensus-specific stuff, so this looks a bit off to me. Could you clarify? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc File src/kudu/server/server_base.cc: http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@430 PS2, Line 430: Calculates the free space on the WAL disk nit: add a period in the end of the sentence http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@431 PS2, Line 431: unique_ptr<FsManager> &fs_manager I'm not sure it makes sense to pass unique_ptr by a reference: why not to pass just a pointer to FsManager* instead or even a reference to FsManager since GetWalsRootDir() is supposed to be a constant method? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@431 PS2, Line 431: ServerBaseOptions options Why not to pass ServerBaseOptions as a const reference? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@434 PS2, Line 434: space_info_waldir.free_bytes - FLAGS_fs_wal_dir_reserved_bytes; There might be dragons here: what if this turns to be a negative number? What would this function then return given the return type is uint64_t? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@438 PS2, Line 438: // multiple directories on a single disk nit: add a period in the end of the sentence http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@439 PS2, Line 439: const unique_ptr<FsManager> &fs_manager Why not to use just 'const FsManager&' here? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@446 PS2, Line 446: FLAGS_fs_data_dirs_reserved_bytes What if this is set to the default value of `-1`? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@446 PS2, Line 446: total_free_space += There might be dragons here: what if (space_info_datadir.free_bytes - FLAGS_fs_data_dirs_reserved_bytes) turns to be negative and abs(total_free_space) < abs(space_info_datadir.free_bytes - FLAGS_fs_data_dirs_reserved_bytes) ? http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/server/server_base.cc@447 PS2, Line 447: unique_fsid.insert(space_info_datadir.filesystem_id); Maybe, instead of this check-and-then-insert pattern, use simply try-insert-and-check-whether-inserted to avoid double-lookup in the dictionary. For that, it's possible to use InsertIfNotPresent() or alike. http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/util/env.h File src/kudu/util/env.h: http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/util/env.h@48 PS2, Line 48: nit: it would be nice to align this comment with two comment above http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/util/env_posix.cc File src/kudu/util/env_posix.cc: http://gerrit.cloudera.org:8080/#/c/17725/2/src/kudu/util/env_posix.cc@1447 PS2, Line 1447: nit: the indent is off -- 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: 2 Gerrit-Owner: Abhishek Chennaka <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241) Gerrit-Comment-Date: Mon, 26 Jul 2021 18:38:33 +0000 Gerrit-HasComments: Yes
