Try setting ScanConsistency.REQUEST_PLUS
for your delete queries
See https://docs.couchbase.com/java-sdk/2.7/scan-consistency-examples.html
“Not bounded” being the default, the query engine will grab and return what is in the index right now. It is the fastest option, but not suitable for “read your own writes” since they may not yet be indexed.
At the other end of the scale there is “request plus” which will — when a query is performed — wait until all of the indexes used have caught up to their highest internal sequence numbers. This will make sure that you read your own writes, but it might take some time if there is a write-heavy workload. Also sometimes you are only interested in the last mutation(s) you performed, so waiting for everything else in the index to be updated can mean unnecessary latency.