Skip to content

Commit

Permalink
Retry Db_AddColumnSync failure in CreateTables
Browse files Browse the repository at this point in the history
It is observed that sometimes the cassandra connection/session returns
no host available error on startup after adding few tables when trying
to update the SystemObjectTable in CreateTables. We need to retry in
this scenario instead of asserting.

Change-Id: I09f16367c40101faced382042d8a301c6764a921
Closes-Bug: #1529563
  • Loading branch information
Megh Bhatt committed Feb 9, 2016
1 parent 20cd46e commit 68a84df
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/analytics/db_handler.cc
Expand Up @@ -232,7 +232,9 @@ bool DbHandler::CreateTables() {
columns.push_back(stat_col);

if (!dbif_->Db_AddColumnSync(col_list)) {
VIZD_ASSERT(0);
DB_LOG(ERROR, g_viz_constants.SYSTEM_OBJECT_TABLE <<
": Start Time Column Add FAILED");
return false;
}
}

Expand Down Expand Up @@ -267,7 +269,9 @@ bool DbHandler::CreateTables() {
columns.push_back(stat_col);

if (!dbif_->Db_AddColumnSync(col_list)) {
VIZD_ASSERT(0);
DB_LOG(ERROR, g_viz_constants.SYSTEM_OBJECT_TABLE <<
": TTL Column Add FAILED");
return false;
}
}

Expand Down

0 comments on commit 68a84df

Please sign in to comment.