From 25e488d4db6d8e97f670aef0d5b7f465197fb0be Mon Sep 17 00:00:00 2001 From: Sanket Kedia Date: Thu, 21 Jul 2022 14:55:10 -0700 Subject: [PATCH] [#13022]DST: Compilation errors on gcc11 Summary: Commit 675d486e7529f171803202c1ef7a9f73ffd0e228 introduced compilation error on gcc11. This diff fixes them. The following errors were noticed: ``` /------------------------------------------------------------------------------- [2022-07-21T06:22:35.385Z] | COMPILATION FAILED [2022-07-21T06:22:35.385Z] |------------------------------------------------------------------------------- [2022-07-21T06:22:35.385Z] ent/src/yb/master/restore_sys_catalog_state.cc:282:5: error: multi-line comment [-Werror=comment] [2022-07-21T06:22:35.385Z] 282 | // / \ [2022-07-21T06:22:35.385Z] | ^ [2022-07-21T06:22:35.385Z] ent/src/yb/master/restore_sys_catalog_state.cc:284:5: error: multi-line comment [-Werror=comment] [2022-07-21T06:22:35.385Z] 284 | // / \ / \ [2022-07-21T06:22:35.385Z] | ^ [2022-07-21T06:22:35.385Z] cc1plus: all warnings being treated as errors [2022-07-21T06:22:35.385Z] [2022-07-21T06:22:35.385Z] Input files: [2022-07-21T06:22:35.385Z] src/yb/master/CMakeFiles/master.dir/__/__/__/ent/src/yb/master/restore_sys_catalog_state.cc.o [2022-07-21T06:22:35.385Z] ent/src/yb/master/restore_sys_catalog_state.cc [2022-07-21T06:22:35.385Z] Output file (from -o): src/yb/master/CMakeFiles/master.dir/__/__/__/ent/src/yb/master/restore_sys_catalog_state.cc.o [2022-07-21T06:22:35.385Z] \------------------------------------------------------------------------------- ``` ``` /------------------------------------------------------------------------------- [2022-07-21T06:22:25.963Z] | COMPILATION FAILED [2022-07-21T06:22:25.963Z] |------------------------------------------------------------------------------- [2022-07-21T06:22:25.963Z] src/yb/master/master_snapshot_coordinator.cc: In member function 'yb::Status yb::master::MasterSnapshotCoordinator::Impl::RestoreSysCatalogReplicated(int64_t, const yb::tablet::SnapshotOperation&, yb::Status*)': [2022-07-21T06:22:25.963Z] src/yb/master/master_snapshot_coordinator.cc:466:5: error: missing initializer for member 'yb::master::SnapshotScheduleRestoration::non_system_tablets_to_restore' [-Werror=missing-field-initializers] [2022-07-21T06:22:25.963Z] 466 | }); [2022-07-21T06:22:25.963Z] | ^ [2022-07-21T06:22:25.963Z] cc1plus: all warnings being treated as errors [2022-07-21T06:22:25.963Z] [2022-07-21T06:22:25.963Z] Input files: [2022-07-21T06:22:25.963Z] src/yb/master/CMakeFiles/master.dir/master_snapshot_coordinator.cc.o [2022-07-21T06:22:25.963Z] src/yb/master/master_snapshot_coordinator.cc [2022-07-21T06:22:25.963Z] Output file (from -o): src/yb/master/CMakeFiles/master.dir/master_snapshot_coordinator.cc.o [2022-07-21T06:22:25.963Z] \------------------------------------------------------------------------------- ``` Test Plan: Jenkins Reviewers: asrivastava Reviewed By: asrivastava Subscribers: jason, zyu, ybase, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D18482 --- ent/src/yb/master/restore_sys_catalog_state.cc | 11 ++++++----- ent/src/yb/master/restore_sys_catalog_state_test.cc | 1 + src/yb/master/master_snapshot_coordinator.cc | 1 + 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ent/src/yb/master/restore_sys_catalog_state.cc b/ent/src/yb/master/restore_sys_catalog_state.cc index 4bbd553a6dd0..57ce89c3ed96 100644 --- a/ent/src/yb/master/restore_sys_catalog_state.cc +++ b/ent/src/yb/master/restore_sys_catalog_state.cc @@ -278,11 +278,12 @@ Status RestoreSysCatalogState::PatchAndAddRestoringTablets() { // Some examples: // // Example#1: Non-colocated split tablet that has finished split completely as of restore time - // t1 - // / \ - // t11 t12 <-- Restoring time - // / \ / \ - // t111 t112 t121 t122 <-- Present time + /* t1 + / \ + t11 t12 <-- Restoring time + / \ / \ + t111 t112 t121 t122 <-- Present time + */ // If we are restoring to a state when t1 was completely split into t11 and t12 then // in the restoring state, the split map will contain two entries // one each for t11 and t12. Both the entries will only have the parent diff --git a/ent/src/yb/master/restore_sys_catalog_state_test.cc b/ent/src/yb/master/restore_sys_catalog_state_test.cc index abb273ab877f..d9f086cc93ff 100644 --- a/ent/src/yb/master/restore_sys_catalog_state_test.cc +++ b/ent/src/yb/master/restore_sys_catalog_state_test.cc @@ -54,6 +54,7 @@ TEST(RestoreSysCatalogStateTest, Filter) { .non_system_objects_to_restore = {}, .existing_system_tables = {}, .restoring_system_tables = {}, + .non_system_tablets_to_restore = {}, }; RestoreSysCatalogState state(&restoration); SysNamespaceEntryPB namespace_entry; diff --git a/src/yb/master/master_snapshot_coordinator.cc b/src/yb/master/master_snapshot_coordinator.cc index 73951aafac04..4b1e06b60a6d 100644 --- a/src/yb/master/master_snapshot_coordinator.cc +++ b/src/yb/master/master_snapshot_coordinator.cc @@ -463,6 +463,7 @@ class MasterSnapshotCoordinator::Impl { .non_system_objects_to_restore = {}, .existing_system_tables = {}, .restoring_system_tables = {}, + .non_system_tablets_to_restore = {}, }); { std::lock_guard lock(mutex_);