We’re experiencing some weird results with indices and count() in PSMDB (PerconaFT engine) on collections with high read/write access.
At first we got some wrong numbers: count() => 3 but real 94 entries.
So we decided to do a reindex() on that collection. After the reindex we get negative counts like e.g. -88 when only 2 documents are in the collection!
There seems something wrong with indices! E.g.
db.reports.count() // Returns 29
db.reports.find() // Returns 46 entries
db.reports.count({ “count”: { $gte: 0 } }) // Returns 46
db.reports.find({ “count”: { $gte: 0 } }) // Returns 46 entries
‘count’ field in a non-index field.
Any ideas what’s wrong? Re-indexing didn’t fix it! Also stats() on that collection returns a negative size:
“ns” : “data.mails”,
“count” : -88,
“size” : -2532158,
“avgObjSize” : 0,
“storageSize” : 805306368,
“capped” : false,
Best, Tom
PS: some additional data
OS: Deb8
ReplicaSet 3 nodes
PSMDB 3.2.10-3.0