mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-22 20:54:49 +09:00
B #1555: Replicate log on leadership changes
(cherry picked from commit 5c97553267)
This commit is contained in:
1 parent
a4c0447ccf
commit
97f957460f
6 files changed
+142
-36
No files matched your search
+8
-3
@@ -65,14 +65,14 @@ int PoolSQL::get_lastOID()
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
static void _set_lastOID(int _last_oid, SqlDB * db, const string& table)
|
||||
static int _set_lastOID(int _last_oid, SqlDB * db, const string& table)
|
||||
{
|
||||
ostringstream oss;
|
||||
|
||||
oss << "REPLACE INTO pool_control (tablename, last_oid) VALUES ('" << table
|
||||
<< "'," << _last_oid << ")";
|
||||
|
||||
db->exec_wr(oss);
|
||||
return db->exec_wr(oss);
|
||||
}
|
||||
|
||||
void PoolSQL::set_lastOID(int _last_oid)
|
||||
@@ -137,7 +137,12 @@ int PoolSQL::allocate(PoolObjectSQL *objsql, string& error_str)
|
||||
|
||||
objsql->oid = ++lastOID;
|
||||
|
||||
_set_lastOID(lastOID, db, table);
|
||||
if ( _set_lastOID(lastOID, db, table) == -1 )
|
||||
{
|
||||
unlock();
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = objsql->insert(db, error_str);
|
||||
|
||||
|
||||
Reference in new issue
Block a user