From a0ed6d768499fecc5557f8129898d2aa9b2908a4 Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Thu, 13 Feb 2025 17:08:20 -0500 Subject: [PATCH 1/7] DOCSP-46301-clean-verify-data --- source/reference/verification.txt | 63 +------------- .../reference/verification/custom-manual.txt | 86 +++++++++++++++++++ 2 files changed, 89 insertions(+), 60 deletions(-) create mode 100644 source/reference/verification/custom-manual.txt diff --git a/source/reference/verification.txt b/source/reference/verification.txt index a8895db47..4bb878011 100644 --- a/source/reference/verification.txt +++ b/source/reference/verification.txt @@ -92,66 +92,8 @@ source to the destination cluster. and replica sets that use MongoDB 4.4 or earlier releases, since the document field order can vary. - * - Document Comparison - - You can verify sync by comparing documents on the source - and destination clusters. - - Write a script that queries collections on the source - cluster and then checks that the correct documents, - indexes, collections, metadata, and views exist with the - same values on the destination cluster. - - Before you can verify data transfer with this method, - ``mongosync`` must be in the ``COMMITTED`` state. - - * - .. _c2c-index-comparison: - - Index Comparison - - To verify the transfer of indexes, run the - :method:`db.collection.getIndexes` method on the source - and destination clusters and compare the results. - - * - .. _c2c-metadata-comparison: - - Metadata Comparison - - To verify the transfer of metadata, run the - :method:`db.getCollectionInfos` method on the source and - destination clusters and compare the results. - - * - .. _c2c-shardkey-comparison: - - Shard Key Comparison - - To verify the transfer of shard keys to a synced collection, run a query on the ``config.collections`` - collection to find a document whose ``_id`` value is the namespace of the target collection. - Compare the ``key`` value of this document in the source and destination clusters. - - For example, for a collection named ``pets`` in the ``records`` database, you can verify the shard key - using the following query in :binary:`mongosh`: - - .. io-code-block:: - :copyable: true - - .. input:: - :language: javascript - - db.getSiblingDB("config").collections.find({ _id : "records.pets" }) - - .. output:: - :language: javascript - :emphasize-lines: 5-7 - :visible: false - - { - "_id" : "records.pets", - "lastmod" : ISODate("2021-07-21T15:48:15.193Z"), - "timestamp": Timestamp(1626882495, 1), - "key" : { - "_id" : 1 - }, - "unique" : false, - "lastmodEpoch" : ObjectId("5078407bd58b175c5c225fdc"), - "uuid" : UUID("f8669e52-5c1b-4ea2-bbdc-a00189b341da") - } + * - :ref:`Custom or Manual Verification ` + - Different types of data require different methods of verification. * - :ref:`Migration Verifier ` - Migration Verifier connects to the source and destination @@ -169,6 +111,7 @@ application workload and the complexity of the data. Use Document Counts Use Hash Comparison Use Migration Verifier + Custom or Manual Verification Learn More ---------- diff --git a/source/reference/verification/custom-manual.txt b/source/reference/verification/custom-manual.txt new file mode 100644 index 000000000..98f328f8d --- /dev/null +++ b/source/reference/verification/custom-manual.txt @@ -0,0 +1,86 @@ +.. _c2c-custom-manual-verification: + +================================== +Custom or Manual Verification Page +================================== + +.. default-domain:: mongodb + +.. facet:: + :name: genre + :values: tutorial + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +.. _c2c-document-comparison: + +Document Comparison +------------------- + +You can verify sync by comparing documents on the source and destination +clusters. + +Write a script that queries collections on the source cluster and then checks +that the correct documents, indexes, collections, metadata, and views exist with +the same values on the destination cluster. + +Before you can verify data transfer with this method, ``mongosync`` must be in +the ``COMMITTED`` state. + +.. _c2c-index-comparison: + +Index Comparison +---------------- + +To verify the transfer of indexes, run the :method:`db.collection.getIndexes` +method on the source and destination clusters and compare the results. + +.. _c2c-metadata-comparison: + +Metadata Comparison +------------------- + +To verify the transfer of metadata, run the :method:`db.getCollectionInfos` method +on the source and destination clusters and compare the results. + +.. _c2c-shardkey-comparison: + +Shard Key Comparison +-------------------- + +To verify the transfer of shard keys to a synced collection, run a query on the +``config.collections`` collection to find a document whose ``_id`` value is the +namespace of the target collection. Compare the ``key`` value of this document +in the source and destination clusters. + +For example, for a collection named ``pets`` in the ``records`` database, you +can verify the shard key using the following query in :binary:`mongosh`: + +.. io-code-block:: + :copyable: true + + .. input:: + :language: javascript + + db.getSiblingDB("config").collections.find({ _id : "records.pets" }) + + .. output:: + :language: javascript + :emphasize-lines: 5-7 + :visible: false + + { + "_id" : "records.pets", + "lastmod" : ISODate("2021-07-21T15:48:15.193Z"), + "timestamp": Timestamp(1626882495, 1), + "key" : { + "_id" : 1 + }, + "unique" : false, + "lastmodEpoch" : ObjectId("5078407bd58b175c5c225fdc"), + "uuid" : UUID("f8669e52-5c1b-4ea2-bbdc-a00189b341da") + } \ No newline at end of file From ce5fcc523c59355c73e136bd827d0b508e747072 Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Thu, 13 Feb 2025 17:16:38 -0500 Subject: [PATCH 2/7] move code --- source/reference/verification/custom-manual.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/reference/verification/custom-manual.txt b/source/reference/verification/custom-manual.txt index 98f328f8d..3018f75e3 100644 --- a/source/reference/verification/custom-manual.txt +++ b/source/reference/verification/custom-manual.txt @@ -64,16 +64,16 @@ can verify the shard key using the following query in :binary:`mongosh`: :copyable: true .. input:: - :language: javascript + :language: javascript - db.getSiblingDB("config").collections.find({ _id : "records.pets" }) + db.getSiblingDB("config").collections.find({ _id : "records.pets" }) .. output:: - :language: javascript - :emphasize-lines: 5-7 - :visible: false + :language: javascript + :emphasize-lines: 5-7 + :visible: false - { + { "_id" : "records.pets", "lastmod" : ISODate("2021-07-21T15:48:15.193Z"), "timestamp": Timestamp(1626882495, 1), From bda591fc1830e2693ec31bcda39106b2b73b6709 Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Fri, 14 Feb 2025 16:11:12 -0500 Subject: [PATCH 3/7] fix indent errors --- source/reference/verification/custom-manual.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/reference/verification/custom-manual.txt b/source/reference/verification/custom-manual.txt index 3018f75e3..50d17e3d1 100644 --- a/source/reference/verification/custom-manual.txt +++ b/source/reference/verification/custom-manual.txt @@ -64,9 +64,9 @@ can verify the shard key using the following query in :binary:`mongosh`: :copyable: true .. input:: - :language: javascript + :language: javascript - db.getSiblingDB("config").collections.find({ _id : "records.pets" }) + db.getSiblingDB("config").collections.find({ _id : "records.pets" }) .. output:: :language: javascript From 1a37608a90b3fcc006c57e4bbe0331806e29b9fd Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Fri, 21 Feb 2025 13:49:01 -0500 Subject: [PATCH 4/7] changing table --- source/reference/verification.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/reference/verification.txt b/source/reference/verification.txt index 4bb878011..92a01f3cc 100644 --- a/source/reference/verification.txt +++ b/source/reference/verification.txt @@ -92,15 +92,18 @@ source to the destination cluster. and replica sets that use MongoDB 4.4 or earlier releases, since the document field order can vary. - * - :ref:`Custom or Manual Verification ` - - Different types of data require different methods of verification. - * - :ref:`Migration Verifier ` - Migration Verifier connects to the source and destination clusters and performs a series of verification checks, comparing documents, views, and indexes to confirm the sync was successful. + * - :ref:`Custom or Manual Verification ` + - Different types of data require different methods of verification. You can + can use custom or manual verification to verify :ref:`documents `, + :ref: `indexes `, :ref: `metadata `, + and `shard keys `. + The specific method you use to verify your data depends on your application workload and the complexity of the data. From 15a0a68058962c2b54e7f69c0f4f4f727f70b2f1 Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Fri, 21 Feb 2025 14:04:29 -0500 Subject: [PATCH 5/7] fix links --- source/reference/verification.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/reference/verification.txt b/source/reference/verification.txt index 92a01f3cc..f962ad108 100644 --- a/source/reference/verification.txt +++ b/source/reference/verification.txt @@ -101,8 +101,8 @@ source to the destination cluster. * - :ref:`Custom or Manual Verification ` - Different types of data require different methods of verification. You can can use custom or manual verification to verify :ref:`documents `, - :ref: `indexes `, :ref: `metadata `, - and `shard keys `. + :ref:`indexes `, :ref:`metadata `, + and :ref:`shard keys `. The specific method you use to verify your data depends on your application workload and the complexity of the data. From dd9d3bb6d58ca81d48be4e86beab1199ce55bc0a Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Tue, 25 Feb 2025 13:48:36 -0500 Subject: [PATCH 6/7] feedback --- source/reference/verification.txt | 4 +-- .../reference/verification/custom-manual.txt | 30 +++++++++---------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/source/reference/verification.txt b/source/reference/verification.txt index f962ad108..fc18f066e 100644 --- a/source/reference/verification.txt +++ b/source/reference/verification.txt @@ -98,7 +98,7 @@ source to the destination cluster. comparing documents, views, and indexes to confirm the sync was successful. - * - :ref:`Custom or Manual Verification ` + * - :ref:`Verifying Data with Custom Scripts ` - Different types of data require different methods of verification. You can can use custom or manual verification to verify :ref:`documents `, :ref:`indexes `, :ref:`metadata `, @@ -114,7 +114,7 @@ application workload and the complexity of the data. Use Document Counts Use Hash Comparison Use Migration Verifier - Custom or Manual Verification + Verifying Data with Custom Scripts Learn More ---------- diff --git a/source/reference/verification/custom-manual.txt b/source/reference/verification/custom-manual.txt index 50d17e3d1..24919af3a 100644 --- a/source/reference/verification/custom-manual.txt +++ b/source/reference/verification/custom-manual.txt @@ -1,7 +1,7 @@ .. _c2c-custom-manual-verification: ================================== -Custom or Manual Verification Page +Verifying Data with Custom Scripts ================================== .. default-domain:: mongodb @@ -16,40 +16,38 @@ Custom or Manual Verification Page :depth: 1 :class: singlecol +You can write a script to query your source cluster and compare the documents, +indexes, collections, metadata, and views with the destination cluster. + .. _c2c-document-comparison: -Document Comparison +Comparing Documents ------------------- -You can verify sync by comparing documents on the source and destination -clusters. - -Write a script that queries collections on the source cluster and then checks -that the correct documents, indexes, collections, metadata, and views exist with -the same values on the destination cluster. +You can verify sync by comparing documents on the source and destination clusters. Before you can verify data transfer with this method, ``mongosync`` must be in the ``COMMITTED`` state. .. _c2c-index-comparison: -Index Comparison ----------------- +Comparing Indexes +----------------- -To verify the transfer of indexes, run the :method:`db.collection.getIndexes` -method on the source and destination clusters and compare the results. +To verify the transfer of indexes, run :method:`db.collection.getIndexes` +on the source and destination clusters and compare the results. .. _c2c-metadata-comparison: -Metadata Comparison -------------------- +Comparing Metadata +------------------ -To verify the transfer of metadata, run the :method:`db.getCollectionInfos` method +To verify the transfer of metadata, run :method:`db.getCollectionInfos` on the source and destination clusters and compare the results. .. _c2c-shardkey-comparison: -Shard Key Comparison +Comparing Shard Keys -------------------- To verify the transfer of shard keys to a synced collection, run a query on the From 9ba6958c8baac6748f598caf6577dfe0c1f24957 Mon Sep 17 00:00:00 2001 From: Grace Miller Date: Tue, 25 Feb 2025 16:09:09 -0500 Subject: [PATCH 7/7] build errors --- .../reference/verification/custom-manual.txt | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/source/reference/verification/custom-manual.txt b/source/reference/verification/custom-manual.txt index 24919af3a..97be7d168 100644 --- a/source/reference/verification/custom-manual.txt +++ b/source/reference/verification/custom-manual.txt @@ -59,26 +59,26 @@ For example, for a collection named ``pets`` in the ``records`` database, you can verify the shard key using the following query in :binary:`mongosh`: .. io-code-block:: - :copyable: true - - .. input:: - :language: javascript - - db.getSiblingDB("config").collections.find({ _id : "records.pets" }) - - .. output:: - :language: javascript - :emphasize-lines: 5-7 - :visible: false - - { - "_id" : "records.pets", - "lastmod" : ISODate("2021-07-21T15:48:15.193Z"), - "timestamp": Timestamp(1626882495, 1), - "key" : { - "_id" : 1 - }, - "unique" : false, - "lastmodEpoch" : ObjectId("5078407bd58b175c5c225fdc"), - "uuid" : UUID("f8669e52-5c1b-4ea2-bbdc-a00189b341da") - } \ No newline at end of file + :copyable: true + + .. input:: + :language: javascript + + db.getSiblingDB("config").collections.find({ _id : "records.pets" }) + + .. output:: + :language: javascript + :emphasize-lines: 5-7 + :visible: false + + { + "_id" : "records.pets", + "lastmod" : ISODate("2021-07-21T15:48:15.193Z"), + "timestamp": Timestamp(1626882495, 1), + "key" : { + "_id" : 1 + }, + "unique" : false, + "lastmodEpoch" : ObjectId("5078407bd58b175c5c225fdc"), + "uuid" : UUID("f8669e52-5c1b-4ea2-bbdc-a00189b341da") + } \ No newline at end of file