mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 05:27:20 +09:00
F #4809: Initialize last_index of federated log when starting replica
threads
This commit is contained in:
1 parent
31ba4d4d85
commit
afca14d75c
2 files changed
+14
-3
No files matched your search
@@ -106,6 +106,8 @@ public:
|
||||
|
||||
update_zones(zids);
|
||||
|
||||
get_last_index(last_index);
|
||||
|
||||
ReplicaManager::start_replica_threads(zids);
|
||||
}
|
||||
|
||||
@@ -203,7 +205,6 @@ private:
|
||||
|
||||
std::string log_retention;
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Action Listener interface
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
@@ -36,7 +36,7 @@ const time_t FedReplicaManager::xmlrpc_timeout_ms = 2000;
|
||||
|
||||
FedReplicaManager::FedReplicaManager(time_t _t, time_t _p, SqlDB * d,
|
||||
const std::string& l): ReplicaManager(), timer_period(_t), purge_period(_p),
|
||||
logdb(d), log_retention(l)
|
||||
last_index(-1), logdb(d), log_retention(l)
|
||||
{
|
||||
pthread_mutex_init(&mutex, 0);
|
||||
|
||||
@@ -399,9 +399,19 @@ int FedReplicaManager::get_last_index(unsigned int& index)
|
||||
|
||||
int FedReplicaManager::bootstrap(SqlDB *_db)
|
||||
{
|
||||
int rc;
|
||||
|
||||
std::ostringstream oss(db_bootstrap);
|
||||
|
||||
return _db->exec_local_wr(oss);
|
||||
rc = _db->exec_local_wr(oss);
|
||||
|
||||
oss.str("");
|
||||
|
||||
oss << "REPLACE INTO " << table << " ("<< db_names <<") VALUES (-1,-1)";
|
||||
|
||||
rc += _db->exec_local_wr(oss);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
Reference in new issue
Block a user