fixes: #1514 /claim #1514
new oplog entries:
BeginRemoteTransaction
- Begins a transaction operation - entry is added to oplog after transaction beginPreCommitRemoteTransaction
- Pre-Commit of the transaction, indicating that the transaction will be committed - entry is added to oplog before transaction commit is executedPreRollbackRemoteTransaction
- Pre-Rollback of the transaction, indicating that the transaction will be rolled back - entry is added to oplog before transaction rollback is executedCommittedRemoteTransaction
- Committed transaction operation, indicating that the transaction was committed - entry is added to oplog after successful transaction commitRolledBackRemoteTransaction
- Rolled back transaction operation, indicating that the transaction was rolled back - entry is added to oplog after successful transaction rollbackBeginRemoteTransaction
is first oplog entry related to DB transaction
PreCommitRemoteTransaction
and CommittedRemoteTransaction
entries will be around DB commit
PreRollbackRemoteTransaction
and RolledBackRemoteTransaction
entries will be around DB rollback
CommittedRemoteTransaction
or RolledBackRemoteTransaction
oplog entry is last oplog entry related to transaction
TODO:
TestOplog
where append of oplog entries failing based on patterns in worker name. Oplog functions do not have Result
as return type, in case of error, it just ends with panic, (PrimaryOplog), in this PR new oplog functions were added, where add of entry have in response Result type
- discuss Oplog function with Result
as return type, find better way how to control when specific action should failoplog snippet
[
{
"type": "BeginRemoteTransaction",
"timestamp": "2025-06-04T17:51:36.626Z",
"transactionId": "740"
},
{
"type": "ImportedFunctionInvoked",
"timestamp": "2025-06-04T17:51:36.638Z",
"functionName": "rdbms::postgres::db-transaction::execute",
"request": { ...
},
"response": {...
},
"wrappedFunctionType": {
"type": "WriteRemoteTransaction",
"index": 16
}
},
{
"type": "Error",
"timestamp": "2025-06-04T17:51:36.662Z",
"error": "error while executing at wasm backtrace:\n 0: 0x3fc08 - wit-component:shim!indirect-golem:rdbms/postgres@0.0.1-[method]db-transaction.commit\n 1: 0x2a6a1 - <unknown>!<wasm function 231>\n 2: 0x2af54 - <unknown>!<wasm function 238>: Runtime error: worker rdbms-service-postgres-763b5c94-2128-4fca-b130-682ffaa8ec10-Fail1OnPreCommitRemoteTransaction failed on PreCommitRemoteTransaction 1 times"
},
{
"type": "Jump",
"timestamp": "2025-06-04T17:51:36.842Z",
"jump": {
"start": 16,
"end": 21
}
},
{
"type": "BeginRemoteTransaction",
"timestamp": "2025-06-04T17:51:36.848Z",
"transactionId": "744"
},
{
"type": "ImportedFunctionInvoked",
"timestamp": "2025-06-04T17:51:36.857Z",
"functionName": "rdbms::postgres::db-transaction::execute",
"request": {...
},
"response": {...
},
"wrappedFunctionType": {
"type": "WriteRemoteTransaction",
"index": 22
}
},
{
"type": "PreCommitRemoteTransaction",
"timestamp": "2025-06-04T17:51:36.868Z",
"beginIndex": 22
},
{
"type": "CommitedRemoteTransaction",
"timestamp": "2025-06-04T17:51:36.888Z",
"beginIndex": 22 }
]
where transaction failed on commit, on appending PreCommitRemoteTransaction
entry to oplog, which means transaction was not commited, and was restarted
Peter Kotula
@justcoon
Golem Cloud
@golemcloud