Improve transaction logging in case of failing hooks
It was discovered that when the pre-receive hook declines because of transaction-unrelated reasons (e.g. because of blob size limits), there is a log message transaction: primary failed vote
. This is being caused by a combination of two things:
- Hooks are only executed on the primary. Thus the RPC will also only fail on the primary, secondaries will vote as expected.
- The pre-receive hook will execute all checks before doing the vote. Thus it'll first notice that a blob is too big and abort.
Together, it means that secondary nodes will vote while the primary doesn't, causing above error message. While this doesn't impact operations, the generated error message is misleading.