@@ -176,6 +176,7 @@ end process
176176process ConsumerProcess = "Consumer"
177177variables
178178 maxUnsafeAutoIdTimestamp \in { 0 , DocAutoIdTimestamp - 1 , DocAutoIdTimestamp , DocAutoIdTimestamp + 1 } ,
179+ maxSeqNoOfNonAppendOnlyOperations \in { 0 , 2 , request_count + 1 } ,
179180 req , plan ,
180181 deleteFromLucene , currentlyDeleted ,
181182 currentNotFoundOrDeleted , useLuceneUpdateDocument , indexIntoLucene ,
@@ -194,6 +195,8 @@ begin
194195
195196 (* planDeletionAsNonPrimary *)
196197
198+ maxSeqNoOfNonAppendOnlyOperations := Max(maxSeqNoOfNonAppendOnlyOperations, req. seqno ) ;
199+
197200 if req . seqno <= localCheckPoint
198201 then
199202 (* OP_STALE_OR_EQUAL *)
@@ -282,12 +285,17 @@ begin
282285
283286 if /\ req . type = ADD
284287 /\ maxUnsafeAutoIdTimestamp < req . autoIdTimeStamp
288+ /\ maxSeqNoOfNonAppendOnlyOperations < req . seqno \* PR #28787
285289 then
286290 plan := "optimisedAppendOnly" ;
287291 currentNotFoundOrDeleted := TRUE;
288292 useLuceneUpdateDocument := FALSE;
289293 indexIntoLucene := TRUE;
290294 else
295+ if FALSE = ( req . type \in { ADD , RETRY_ADD } )
296+ then
297+ maxSeqNoOfNonAppendOnlyOperations := Max ( maxSeqNoOfNonAppendOnlyOperations , req . seqno ) ;
298+ end if;
291299
292300 (* All other operations are planned normally *)
293301 versionMap_needsSafeAccess := TRUE;
0 commit comments