mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
M #-: Fix HA replication bug (#3432)
(cherry picked from commit 77883d94c516265a1a9cac59b82cd2ca05beea3c)
This commit is contained in:
parent
995ec0ca7d
commit
f852bc6ead
@ -330,24 +330,20 @@ int LogDB::insert(uint64_t index, unsigned int term, const std::string& sql,
|
||||
|
||||
if (replace)
|
||||
{
|
||||
oss << "UPDATE " << table << " SET "
|
||||
<< "term = " << term << ", "
|
||||
<< "sqlcmd = '" << sql_db << "', "
|
||||
<< "timestamp = " << tstamp << ", "
|
||||
<< "fed_index = " << fed_index << ", "
|
||||
<< "applied = " << applied
|
||||
<< " WHERE log_index = " << index;
|
||||
oss << "REPLACE";
|
||||
}
|
||||
else
|
||||
{
|
||||
oss << "INSERT INTO " << table << " ("<< db_names <<") VALUES ("
|
||||
oss << "INSERT";
|
||||
}
|
||||
|
||||
oss << " INTO " << table << " ("<< db_names <<") VALUES ("
|
||||
<< index << ","
|
||||
<< term << ","
|
||||
<< "'" << sql_db << "',"
|
||||
<< tstamp << ","
|
||||
<< fed_index << ","
|
||||
<< applied << ")";
|
||||
}
|
||||
|
||||
int rc = db->exec_wr(oss);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user