@@ -35,31 +35,58 @@ The following stack trace indicates that the source connector has an invalid res
35
35
possible, as the resume point may no longer be in the oplog
36
36
...
37
37
38
+
39
+ .. _invalid-resume-token-cause:
40
+
38
41
Cause
39
42
-----
40
43
41
44
When the ID of your source connector's resume token does not correspond to any
42
45
entry in your MongoDB deployment's :ref:`oplog <replica-set-oplog>`,
43
46
your connector has no way to determine where to begin to process your
44
- MongoDB change stream. This issue most commonly occurs when you pause the source
45
- connector and fill the oplog, as outlined in the following scenario:
46
-
47
- #. You start a Kafka deployment with a MongoDB Kafka Connector source connector.
48
- #. You produce change stream events in MongoDB, and your connector stores a
49
- resume token corresponding to the most recent oplog entry in MongoDB.
50
- #. You pause your source connector.
51
- #. While your connector sits idle, you fill your MongoDB oplog such that MongoDB
52
- deletes the oplog entry corresponding to your resume token.
53
- #. You restart your source connector, and it is unable to resume
54
- processing as its resume token does not exist in your MongoDB oplog.
47
+ MongoDB change stream. Click the following tabs to see scenarios
48
+ in which you can experience this issue:
49
+
50
+ .. tabs::
51
+
52
+ .. tab:: Paused Connector
53
+ :tabid: paused-connector
54
+
55
+ In this scenario, you pause your source connector and you fill your MongoDB
56
+ deployment's oplog:
57
+
58
+ #. You start a Kafka deployment with a {+source-connector+}.
59
+ #. You produce a change event in your source MongoDB namespace, and your
60
+ connector stores a resume token corresponding to this event.
61
+ #. You pause your source connector.
62
+ #. While your connector pauses, you fill your MongoDB oplog such that MongoDB
63
+ deletes the oplog entry corresponding to your resume token.
64
+ #. You restart your source connector and it is unable to resume
65
+ processing as its resume token does not exist in your MongoDB oplog.
66
+
67
+
68
+ .. tab:: Infrequently Updated Namespace
69
+ :tabid: infrequently-updated-namespace
70
+
71
+ In this scenario, your source connector listens for changes on an infrequently
72
+ updated MongoDB namespace and the
73
+ :ref:`heartbeat feature <invalid-resume-token-prevention>` is not enabled:
74
+
75
+ #. You start a Kafka deployment with a {+source-connector+}.
76
+ #. You produce a change event in your source MongoDB namespace, and your
77
+ connector stores a resume token corresponding to this event.
78
+ #. Your source MongoDB namespace is not updated in the time it takes for your MongoDB
79
+ deployment to rotate the change event corresponding to your resume token out of its
80
+ oplog.
81
+ #. You produce a change event in your source MongoDB namespace and your
82
+ source connector is unable to resume processing as its resume token does
83
+ not exist in your MongoDB oplog.
55
84
56
85
For more information on the oplog, see the
57
86
:ref:`MongoDB Manual <replica-set-oplog>`.
58
87
59
- .. TODO: update doc link to ref once page is written
60
-
61
88
For more information on change streams, see the
62
- :doc:`guide on change streams </ source-connector/fundamentals/ change-streams>`.
89
+ :ref:`<kafka- source-change-streams>` guide .
63
90
64
91
Solutions
65
92
---------
@@ -102,11 +129,8 @@ To configure your source connector to temporarily tolerate errors:
102
129
103
130
errors.tolerance="none"
104
131
105
- .. TODO: <Confirm linked page discusses errors.tolerance once it's written>
106
- .. TODO: update doc link to ref once page is written
107
-
108
- For more information on the ``errors.tolerance`` option, see the guide on
109
- :ref:`source connector configuration properties <source-configuration-index>`.
132
+ For more information on the ``errors.tolerance`` option, see the
133
+ :ref:`<source-configuration-error-handling>` page.
110
134
111
135
.. _troubleshoot-delete-stored-offsets:
112
136
@@ -145,3 +169,24 @@ mode of your deployment:
145
169
your Kafka Connect deployment.
146
170
147
171
#. Restart your source connector and continue to process change stream events.
172
+
173
+ .. _invalid-resume-token-prevention:
174
+
175
+ Prevention
176
+ ----------
177
+
178
+ To prevent invalid resume token errors caused by an
179
+ :ref:`infrequently updated namespace <invalid-resume-token-cause>`, enable
180
+ **heartbeats**. Heartbeats is a feature of your source connector that causes
181
+ your connector to update its resume token at regular intervals as well as when
182
+ the contents of your source MongoDB namespace changes.
183
+
184
+ Specify the following option in your source connector configuration to enable
185
+ heartbeats:
186
+
187
+ .. code-block:: properties
188
+
189
+ heartbeat.interval.ms=<a positive integer>
190
+
191
+ To learn more about heartbeats, see the
192
+ :ref:`<source-configuration-error-handling>` guide.
0 commit comments