rocketmq icon indicating copy to clipboard operation
rocketmq copied to clipboard

Support escaping transactional messages in slave-acting-master mode

Open caigy opened this issue 3 years ago • 0 comments

FEATURE REQUEST

In RIP-32, Slave Acting Master Mode is supported and the escape of the transactional messages need to be supported.

Below is a simple implementation of escaping transactional messages:

If a slave node is acting as master,

  • EndTransaction requests (including commit and rollback) are denied.
  • When checking status of half messages, escape half messages to an available master directly, without checking transaction status actually. There is a small trick: If a half message is sent to a local master, just append it to half topic; if sent to a remote master, the half message should be restored to original real message, because sending messages to a system topic is forbidden.

This implemetation keeps read-only sematics of slaves, so that no new half messages or op messages will be created in slave acting as master, all actual checking processes of half messages are delivered to master.

Previously there are several proposals, such as #4427, #4477, etc. They do provide good references and I truly appreciate the authors.

caigy avatar Sep 07 '22 02:09 caigy