@@ -801,33 +801,35 @@ bq_queue_index1(_Config) ->
801
801
TwoSegs = SegmentSize + SegmentSize ,
802
802
MostOfASegment = trunc (SegmentSize * 0.75 ),
803
803
SeqIdsA = lists :seq (0 , MostOfASegment - 1 ),
804
+ NextSeqIdA = MostOfASegment ,
804
805
SeqIdsB = lists :seq (MostOfASegment , 2 * MostOfASegment ),
806
+ NextSeqIdB = 2 * MostOfASegment + 1 ,
805
807
SeqIdsC = lists :seq (0 , trunc (SegmentSize / 2 )),
806
808
SeqIdsD = lists :seq (0 , SegmentSize * 4 ),
807
809
808
810
VerifyReadWithPublishedFun = fun verify_read_with_published_v2 /3 ,
809
811
810
812
with_empty_test_queue (
811
813
fun (Qi0 , QName ) ->
812
- {0 , 0 , Qi1 } = IndexMod :bounds (Qi0 ),
814
+ {0 , 0 , Qi1 } = IndexMod :bounds (Qi0 , undefined ),
813
815
{Qi2 , SeqIdsMsgIdsA } = queue_index_publish (SeqIdsA , false , Qi1 ),
814
- {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 ),
816
+ {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 , NextSeqIdA ),
815
817
{ReadA , Qi4 } = IndexMod :read (0 , SegmentSize , Qi3 ),
816
818
ok = VerifyReadWithPublishedFun (false , ReadA ,
817
819
lists :reverse (SeqIdsMsgIdsA )),
818
820
% % should get length back as 0, as all the msgs were transient
819
821
{0 , 0 , Qi6 } = restart_test_queue (Qi4 , QName ),
820
- {0 , 0 , Qi7 } = IndexMod :bounds (Qi6 ),
822
+ {NextSeqIdA , NextSeqIdA , Qi7 } = IndexMod :bounds (Qi6 , NextSeqIdA ),
821
823
{Qi8 , SeqIdsMsgIdsB } = queue_index_publish (SeqIdsB , true , Qi7 ),
822
- {0 , TwoSegs , Qi9 } = IndexMod :bounds (Qi8 ),
824
+ {0 , TwoSegs , Qi9 } = IndexMod :bounds (Qi8 , NextSeqIdB ),
823
825
{ReadB , Qi10 } = IndexMod :read (0 , SegmentSize , Qi9 ),
824
826
ok = VerifyReadWithPublishedFun (true , ReadB ,
825
827
lists :reverse (SeqIdsMsgIdsB )),
826
828
% % should get length back as MostOfASegment
827
829
LenB = length (SeqIdsB ),
828
830
BytesB = LenB * 10 ,
829
831
{LenB , BytesB , Qi12 } = restart_test_queue (Qi10 , QName ),
830
- {0 , TwoSegs , Qi13 } = IndexMod :bounds (Qi12 ),
832
+ {0 , TwoSegs , Qi13 } = IndexMod :bounds (Qi12 , NextSeqIdB ),
831
833
Qi15 = case IndexMod of
832
834
rabbit_queue_index ->
833
835
Qi14 = IndexMod :deliver (SeqIdsB , Qi13 ),
@@ -841,7 +843,7 @@ bq_queue_index1(_Config) ->
841
843
{_DeletedSegments , Qi16 } = IndexMod :ack (SeqIdsB , Qi15 ),
842
844
Qi17 = IndexMod :flush (Qi16 ),
843
845
% % Everything will have gone now because #pubs == #acks
844
- {0 , 0 , Qi18 } = IndexMod :bounds (Qi17 ),
846
+ {NextSeqIdB , NextSeqIdB , Qi18 } = IndexMod :bounds (Qi17 , NextSeqIdB ),
845
847
% % should get length back as 0 because all persistent
846
848
% % msgs have been acked
847
849
{0 , 0 , Qi19 } = restart_test_queue (Qi18 , QName ),
@@ -996,7 +998,7 @@ v2_delete_segment_file_completely_acked1(_Config) ->
996
998
% % Publish a full segment file.
997
999
{Qi1 , SeqIdsMsgIds } = queue_index_publish (SeqIds , true , Qi0 ),
998
1000
SegmentSize = length (SeqIdsMsgIds ),
999
- {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 ),
1001
+ {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 , undefined ),
1000
1002
% % Confirm that the file exists on disk.
1001
1003
Path = IndexMod :segment_file (0 , Qi2 ),
1002
1004
true = filelib :is_file (Path ),
@@ -1024,7 +1026,7 @@ v2_delete_segment_file_partially_acked1(_Config) ->
1024
1026
% % Publish a partial segment file.
1025
1027
{Qi1 , SeqIdsMsgIds } = queue_index_publish (SeqIds , true , Qi0 ),
1026
1028
SeqIdsLen = length (SeqIdsMsgIds ),
1027
- {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 ),
1029
+ {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 , undefined ),
1028
1030
% % Confirm that the file exists on disk.
1029
1031
Path = IndexMod :segment_file (0 , Qi2 ),
1030
1032
true = filelib :is_file (Path ),
@@ -1054,7 +1056,7 @@ v2_delete_segment_file_partially_acked_with_holes1(_Config) ->
1054
1056
{Qi1 , SeqIdsMsgIdsA } = queue_index_publish (SeqIdsA , true , Qi0 ),
1055
1057
{Qi2 , SeqIdsMsgIdsB } = queue_index_publish (SeqIdsB , true , Qi1 ),
1056
1058
SeqIdsLen = length (SeqIdsMsgIdsA ) + length (SeqIdsMsgIdsB ),
1057
- {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 ),
1059
+ {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 , undefined ),
1058
1060
% % Confirm that the file exists on disk.
1059
1061
Path = IndexMod :segment_file (0 , Qi3 ),
1060
1062
true = filelib :is_file (Path ),
0 commit comments