@@ -952,6 +952,10 @@ action_to_entry(RelSeq, Action, JEntries) ->
952
952
({no_pub , del , no_ack }) when Action == ack ->
953
953
{set , {no_pub , del , ack }};
954
954
({? PUB , del , no_ack }) when Action == ack ->
955
+ {reset , none };
956
+ % % Special case, missing del
957
+ % % See journal_minus_segment1/2
958
+ ({? PUB , no_del , no_ack }) when Action == ack ->
955
959
{reset , none }
956
960
end .
957
961
@@ -1342,6 +1346,11 @@ segment_plus_journal1({?PUB = Pub, no_del, no_ack}, {no_pub, del, no_ack}) ->
1342
1346
segment_plus_journal1 ({? PUB , no_del , no_ack }, {no_pub , del , ack }) ->
1343
1347
{undefined , - 1 };
1344
1348
segment_plus_journal1 ({? PUB , del , no_ack }, {no_pub , no_del , ack }) ->
1349
+ {undefined , - 1 };
1350
+
1351
+ % % Special case, missing del
1352
+ % % See journal_minus_segment1/2
1353
+ segment_plus_journal1 ({? PUB , no_del , no_ack }, {no_pub , no_del , ack }) ->
1345
1354
{undefined , - 1 }.
1346
1355
1347
1356
% % Remove from the journal entries for a segment, items that are
@@ -1413,6 +1422,16 @@ journal_minus_segment1({no_pub, no_del, ack}, {?PUB, del, no_ack}) ->
1413
1422
journal_minus_segment1 ({no_pub , no_del , ack }, {? PUB , del , ack }) ->
1414
1423
{undefined , - 1 };
1415
1424
1425
+ % % Just ack in journal, missing del
1426
+ % % Since 3.10 message delivery is tracked per-queue, not per-message,
1427
+ % % but to keep queue index v1 format messages are always marked as
1428
+ % % delivered on publish. But for a message that was published before
1429
+ % % 3.10 this is not the case and the delivery marker can be missing.
1430
+ % % As a workaround we add the del marker because if a message is acked
1431
+ % % it must have been delivered as well.
1432
+ journal_minus_segment1 ({no_pub , no_del , ack }, {? PUB , no_del , no_ack }) ->
1433
+ {{no_pub , del , ack }, 0 };
1434
+
1416
1435
% % Deliver and ack in journal
1417
1436
journal_minus_segment1 ({no_pub , del , ack }, {? PUB , no_del , no_ack }) ->
1418
1437
{keep , 0 };
0 commit comments