mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-19 19:40:41 +01:00
ommysql: do not duplicate entries on failed transaction
If a multi-message batch contains data errors, messages may be duplicated as connection close is implicit commit (not rollback). This patch introduces a specific rollback request in those cases. closes https://github.com/rsyslog/rsyslog/issues/1829
This commit is contained in:
parent
e9a27a0c53
commit
cdd7b62c60
@ -309,6 +309,10 @@ CODESTARTcommitTransaction
|
|||||||
if(iRet != RS_RET_OK
|
if(iRet != RS_RET_OK
|
||||||
&& iRet != RS_RET_DEFER_COMMIT
|
&& iRet != RS_RET_DEFER_COMMIT
|
||||||
&& iRet != RS_RET_PREVIOUS_COMMITTED) {
|
&& iRet != RS_RET_PREVIOUS_COMMITTED) {
|
||||||
|
if(mysql_rollback(pWrkrData->hmysql) != 0) {
|
||||||
|
DBGPRINTF("ommysql: server error: transaction could not be rolled back\n");
|
||||||
|
}
|
||||||
|
closeMySQL(pWrkrData);
|
||||||
FINALIZE;
|
FINALIZE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user