@@ -801,33 +801,35 @@ bq_queue_index1(_Config) ->
801801 TwoSegs = SegmentSize + SegmentSize ,
802802 MostOfASegment = trunc (SegmentSize * 0.75 ),
803803 SeqIdsA = lists :seq (0 , MostOfASegment - 1 ),
804+ NextSeqIdA = MostOfASegment ,
804805 SeqIdsB = lists :seq (MostOfASegment , 2 * MostOfASegment ),
806+ NextSeqIdB = 2 * MostOfASegment + 1 ,
805807 SeqIdsC = lists :seq (0 , trunc (SegmentSize / 2 )),
806808 SeqIdsD = lists :seq (0 , SegmentSize * 4 ),
807809
808810 VerifyReadWithPublishedFun = fun verify_read_with_published_v2 /3 ,
809811
810812 with_empty_test_queue (
811813 fun (Qi0 , QName ) ->
812- {0 , 0 , Qi1 } = IndexMod :bounds (Qi0 ),
814+ {0 , 0 , Qi1 } = IndexMod :bounds (Qi0 , undefined ),
813815 {Qi2 , SeqIdsMsgIdsA } = queue_index_publish (SeqIdsA , false , Qi1 ),
814- {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 ),
816+ {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 , NextSeqIdA ),
815817 {ReadA , Qi4 } = IndexMod :read (0 , SegmentSize , Qi3 ),
816818 ok = VerifyReadWithPublishedFun (false , ReadA ,
817819 lists :reverse (SeqIdsMsgIdsA )),
818820 % % should get length back as 0, as all the msgs were transient
819821 {0 , 0 , Qi6 } = restart_test_queue (Qi4 , QName ),
820- {0 , 0 , Qi7 } = IndexMod :bounds (Qi6 ),
822+ {NextSeqIdA , NextSeqIdA , Qi7 } = IndexMod :bounds (Qi6 , NextSeqIdA ),
821823 {Qi8 , SeqIdsMsgIdsB } = queue_index_publish (SeqIdsB , true , Qi7 ),
822- {0 , TwoSegs , Qi9 } = IndexMod :bounds (Qi8 ),
824+ {0 , TwoSegs , Qi9 } = IndexMod :bounds (Qi8 , NextSeqIdB ),
823825 {ReadB , Qi10 } = IndexMod :read (0 , SegmentSize , Qi9 ),
824826 ok = VerifyReadWithPublishedFun (true , ReadB ,
825827 lists :reverse (SeqIdsMsgIdsB )),
826828 % % should get length back as MostOfASegment
827829 LenB = length (SeqIdsB ),
828830 BytesB = LenB * 10 ,
829831 {LenB , BytesB , Qi12 } = restart_test_queue (Qi10 , QName ),
830- {0 , TwoSegs , Qi13 } = IndexMod :bounds (Qi12 ),
832+ {0 , TwoSegs , Qi13 } = IndexMod :bounds (Qi12 , NextSeqIdB ),
831833 Qi15 = case IndexMod of
832834 rabbit_queue_index ->
833835 Qi14 = IndexMod :deliver (SeqIdsB , Qi13 ),
@@ -841,7 +843,7 @@ bq_queue_index1(_Config) ->
841843 {_DeletedSegments , Qi16 } = IndexMod :ack (SeqIdsB , Qi15 ),
842844 Qi17 = IndexMod :flush (Qi16 ),
843845 % % Everything will have gone now because #pubs == #acks
844- {0 , 0 , Qi18 } = IndexMod :bounds (Qi17 ),
846+ {NextSeqIdB , NextSeqIdB , Qi18 } = IndexMod :bounds (Qi17 , NextSeqIdB ),
845847 % % should get length back as 0 because all persistent
846848 % % msgs have been acked
847849 {0 , 0 , Qi19 } = restart_test_queue (Qi18 , QName ),
@@ -996,7 +998,7 @@ v2_delete_segment_file_completely_acked1(_Config) ->
996998 % % Publish a full segment file.
997999 {Qi1 , SeqIdsMsgIds } = queue_index_publish (SeqIds , true , Qi0 ),
9981000 SegmentSize = length (SeqIdsMsgIds ),
999- {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 ),
1001+ {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 , undefined ),
10001002 % % Confirm that the file exists on disk.
10011003 Path = IndexMod :segment_file (0 , Qi2 ),
10021004 true = filelib :is_file (Path ),
@@ -1024,7 +1026,7 @@ v2_delete_segment_file_partially_acked1(_Config) ->
10241026 % % Publish a partial segment file.
10251027 {Qi1 , SeqIdsMsgIds } = queue_index_publish (SeqIds , true , Qi0 ),
10261028 SeqIdsLen = length (SeqIdsMsgIds ),
1027- {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 ),
1029+ {0 , SegmentSize , Qi2 } = IndexMod :bounds (Qi1 , undefined ),
10281030 % % Confirm that the file exists on disk.
10291031 Path = IndexMod :segment_file (0 , Qi2 ),
10301032 true = filelib :is_file (Path ),
@@ -1054,7 +1056,7 @@ v2_delete_segment_file_partially_acked_with_holes1(_Config) ->
10541056 {Qi1 , SeqIdsMsgIdsA } = queue_index_publish (SeqIdsA , true , Qi0 ),
10551057 {Qi2 , SeqIdsMsgIdsB } = queue_index_publish (SeqIdsB , true , Qi1 ),
10561058 SeqIdsLen = length (SeqIdsMsgIdsA ) + length (SeqIdsMsgIdsB ),
1057- {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 ),
1059+ {0 , SegmentSize , Qi3 } = IndexMod :bounds (Qi2 , undefined ),
10581060 % % Confirm that the file exists on disk.
10591061 Path = IndexMod :segment_file (0 , Qi3 ),
10601062 true = filelib :is_file (Path ),
0 commit comments