-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: 6.0.0-rc8
-
Component/s: None
-
Query Execution
-
ALL
-
QE 2024-10-14, QE 2024-10-28, QE 2024-11-11
It is a known behaviour of deleteMany in a sharded cluster that it could be applied more than one time if there are migrations and furthermore that it will delete orphaned documents. Because of this, the reported count of documents actually deleted could be way off from what actually got deleted.
However, I would expect that the error is on the upper side, not the lower.
It looks like the BatchWritesExecutor is somehow resetting the counter after retries, because if I delete ~400,000 documents (as shown by countDocuments), if there are ongoing migrations, the report was only about ~40,000 even though all of them were in fact deleted.
I only tried on 6.0 and the latest master, but I suspect the problem is present in older versions as well.