From c024f956cc19687f294baa3dded92c7f82480ebb Mon Sep 17 00:00:00 2001 From: deepthi Date: Mon, 9 Sep 2019 11:43:26 -0700 Subject: [PATCH] change fatal to error if we are unable to update local_metadata or shard_metadata Signed-off-by: deepthi --- go/vt/mysqlctl/metadata_tables.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/go/vt/mysqlctl/metadata_tables.go b/go/vt/mysqlctl/metadata_tables.go index d160772346..a3d64d9c86 100644 --- a/go/vt/mysqlctl/metadata_tables.go +++ b/go/vt/mysqlctl/metadata_tables.go @@ -96,8 +96,9 @@ func PopulateMetadataTables(mysqld MysqlDaemon, localMetadata map[string]string, } } } - if _, err := conn.ExecuteFetch(fmt.Sprintf(sqlUpdateLocalMetadataTable, dbName), 0, false); err != nil { - return err + sql := fmt.Sprintf(sqlUpdateLocalMetadataTable, dbName) + if _, err := conn.ExecuteFetch(sql, 0, false); err != nil { + log.Errorf("unexpected error executing %v: %v, continuing. Please check the data in _vt.local_metadata and take corrective action", sql, err) } if _, err := conn.ExecuteFetch(sqlCreateShardMetadataTable, 0, false); err != nil { return err @@ -112,8 +113,9 @@ func PopulateMetadataTables(mysqld MysqlDaemon, localMetadata map[string]string, } } } - if _, err := conn.ExecuteFetch(fmt.Sprintf(sqlUpdateShardMetadataTable, dbName), 0, false); err != nil { - return err + sql = fmt.Sprintf(sqlUpdateShardMetadataTable, dbName) + if _, err := conn.ExecuteFetch(sql, 0, false); err != nil { + log.Errorf("unexpected error executing %v: %v, continuing. Please check the data in _vt.shard_metadata and take corrective action", sql, err) } // Populate local_metadata from the passed list of values.