Data content inconsistency
Issue
Cause analysis
During a full data check, data is continuously written to the source database, and the oplog keeps being updated. The incremental data check task continuously reads the oplog from the source database. If the new oplog generated in the source database has not reached the timestamp in the target database, the data content may be inconsistent for a short period of time, which is normal.
Solution
You can check the inconsistent data row by row. You can also initiate a new check task to perform another manual check. When all the incremental data is migrated to the target database, the content will be consistent.
Data row count inconsistency
Issue
Cause 1
During a full data check, data is continuously written to the source database, and the oplog keeps being updated. The incremental data check task continuously reads the oplog from the source database. If the new oplog generated in the source database has not reached the timestamp in the target database, the number of data rows may be inconsistent for a short period of time, which is normal.
Cause 2
The TencentDB for MongoDB row count check collects the row count in metadata through db.collection.estimatedDocumentCount()
or db.collection.stats()
for comparison, which may be inconsistent with the actual row count under specific circumstances such as unexpected instance shutdown or the presence of orphaned documents.
Solution
In this case, you can use db.collection.countDocuments()
to compare the row count. Note that this requires collection scanning, which may affect the performance. For more information, see db.collection.countDocuments(). Index check
Issue
If you select Index for Database Info when creating a consistency check task, the indexes in the source and target databases will be compared. You may find that the content of the v
and background
fields in the source and target databases are inconsistent, but the check result does not indicate any inconsistency.
Cause analysis
The TencentDB for MongoDB index check policy ignores the inconsistency in the v
(version information) and background
(creation in the background) fields, which will not be indicated in the check result.
Was this page helpful?