Fix[mqb]: Handle orphan confirms - #1195
Conversation
dorjesinpo
commented
Mar 15, 2026
- Do not break on orphan (auto) confirm
- Do not send auto confirms if message refcount is 0
8843758 to
60bcf04
Compare
60bcf04 to
ea8e700
Compare
| d_autoConfirms.emplace_back(appKey, handle); | ||
|
|
||
| return mqbi::StorageResult::e_SUCCESS; | ||
| d_autoConfirms.emplace_back(appKey, DataStoreRecordHandle()); |
There was a problem hiding this comment.
Note that d_autoConfirms now keeps an invalid DataStoreRecordHandle.
What if that record handle never becomes valid (we never call FileBackedStorage::put) and we try to remove it in FileBackedStorage?
blazingmq/src/groups/mqb/mqbs/mqbs_filebackedstorage.cpp
Lines 1174 to 1184 in ea8e700
This might happen when all app subscriptions are negative (so all are auto confirmed) and we try to move to the next message.
See the integration test, I've posted a code update that causes broker to crash
There was a problem hiding this comment.
selectForAutoConfirming should not call clearSelection
d_autoConfirms are used in two mutually exclusive ways - by RootQueueEngine and by replication.
The former never stores valid handles.
ea8e700 to
2a24779
Compare
2a24779 to
b0a70f4
Compare
7224cce to
60590c2
Compare
|
I only reviewed |
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
Signed-off-by: dorjesinpo <129227380+dorjesinpo@users.noreply.github.com>
1a6ae4c to
7c082fd
Compare