|
| 1 | +.. _c2c-states: |
| 2 | + |
| 3 | +==================== |
| 4 | +``mongosync`` States |
| 5 | +==================== |
| 6 | + |
| 7 | +.. default-domain:: mongodb |
| 8 | + |
| 9 | +.. contents:: On this page |
| 10 | + :local: |
| 11 | + :backlinks: none |
| 12 | + :depth: 2 |
| 13 | + :class: singlecol |
| 14 | + |
| 15 | + |
| 16 | +``mongosync`` enters different states depending on the requests it |
| 17 | +receives. This page describes the states that ``mongosync`` can be in. |
| 18 | +``mongosync`` is in a single state at a particular time. The possible |
| 19 | +API operations you can run depend on the state of ``mongosync``. |
| 20 | + |
| 21 | +View the Current State |
| 22 | +---------------------- |
| 23 | + |
| 24 | +To view the current state of ``mongosync``, use the |
| 25 | +:ref:`/progress <c2c-api-progress>`. endpoint. The endpoint returns the |
| 26 | +state in the ``state`` field. |
| 27 | + |
| 28 | +.. _c2c-states-descriptions: |
| 29 | + |
| 30 | +State Descriptions |
| 31 | +------------------ |
| 32 | + |
| 33 | +The following table describes each state and the operations you can run |
| 34 | +when ``mongosync`` is in a given state. |
| 35 | + |
| 36 | +.. list-table:: |
| 37 | + :header-rows: 1 |
| 38 | + :widths: 10 30 20 |
| 39 | + |
| 40 | + * - State |
| 41 | + - Description |
| 42 | + - Possible API Operations |
| 43 | + |
| 44 | + * - ``IDLE`` |
| 45 | + - ``mongosync`` is initialized and ready for a sync job to |
| 46 | + begin. |
| 47 | + - - ``POST`` :ref:`/start <c2c-api-start>` |
| 48 | + - ``GET`` :ref:`/progress <c2c-api-progress>` |
| 49 | + |
| 50 | + * - ``RUNNING`` |
| 51 | + - The sync process is currently running. In this state, data is |
| 52 | + initially synced to the destination cluster, and subsequent |
| 53 | + writes are applied. |
| 54 | + - - ``POST`` :ref:`/pause <c2c-api-pause>` |
| 55 | + - ``POST`` :ref:`/commit <c2c-api-commit>` |
| 56 | + - ``GET`` :ref:`/progress <c2c-api-progress>` |
| 57 | + |
| 58 | + * - ``PAUSED`` |
| 59 | + - The sync process is paused. To resume the sync process, send a |
| 60 | + request to the :ref:`/resume <c2c-api-resume>` endpoint. |
| 61 | + - - ``POST`` :ref:`/resume <c2c-api-resume>` |
| 62 | + - ``GET`` :ref:`/progress <c2c-api-progress>` |
| 63 | + |
| 64 | + * - ``COMMITTING`` |
| 65 | + - The cutover for the sync process has started. The time it takes |
| 66 | + to transition to the ``COMMITTED`` phase depends on |
| 67 | + ``lagTimeSeconds``. To monitor ``lagTimeSeconds`` or see if |
| 68 | + ``mongosync`` has finished committing, use the |
| 69 | + :ref:`/progress <c2c-api-progress>` endpoint. |
| 70 | + - - ``GET`` :ref:`/progress <c2c-api-progress>` |
| 71 | + |
| 72 | + * - ``COMMITTED`` |
| 73 | + - The cutover for the sync process is complete. |
| 74 | + - - ``GET`` :ref:`/progress <c2c-api-progress>` |
0 commit comments