B #1555: Replicate log on leadership changes

(cherry picked from commit 5c97553267)
This commit is contained in:
Ruben S. Montero committed 2018-01-08 00:35:40 +01:00
1 parent a4c0447ccf
commit 97f957460f
6 files changed
+142 -36

No files matched your search

+8 -3
View File
@@ -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);