Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Deferred messages within a transaction not retried #2420
If an output plugin confirms individual messages in a transaction with RS_RET_DEFER_COMMIT, and one of the messages in the transaction fails, one would expect that the previous messages are also retried, not only the one that has caused the transaction to fail.
This is what I understand from the documentation:
I assume this is the correct interpretation: otherwise, what would be the difference between confirming messages with RS_RET_OK and RS_RET_DEFER_COMMIT inside a transaction?
Deferred messages (confirmed with RS_RET_DEFER_COMMIT) in a transaction are not retried if a later message in the transaction fails (with RS_RET_SUSPENDED). Only the failed message is retried.
Note: if the transaction fails during commit (i.e. the plugin returns RS_RET_SUSPENDED in 'endTransaction'), then the messages in the transaction are correctly retried.
Steps to reproduce the behavior
Use the automated test 'omprog-transactions-failed-messages.sh' proposed for merge in PR #1992, modifying the test as explained in the TODO comment (to reproduce the issue, simply remove the two lines mentioned in the TODO).