Skip to content

Molt updates #19675

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/current/_includes/molt/migration-stop-replication.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

1. Wait for replication to drain, which means that all transactions that occurred on the source database have been fully processed and replicated to CockroachDB. There are two ways to determine that replication has fully drained:
- When replication is caught up, you will not see new `upserted rows` logs.
- If you set up the replication metrics endpoint with `--metricsAddr` in the preceding steps, use the following Prometheus alert expression to observe when the combined rate of upserts and deletes is `0` for each schema:
- If you set up the replication metrics endpoint with `--metricsAddr` in the preceding steps, metrics are available at:

~~~
http://{host}:{port}/_/varz
~~~

Use the following Prometheus alert expression to observe when the combined rate of upserts and deletes is `0` for each schema:

~~~
sum by (schema) (rate(apply_upserts_total[$__rate_interval]) + rate(apply_deletes_total[$__rate_interval]))
Expand Down
4 changes: 2 additions & 2 deletions src/current/_includes/molt/replicator-flags.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ The following flags are set with [`--replicator-flags`](#global-flags) and can b
| `--gracePeriod` | `DURATION` | Allow background processes to exit.<br><br>**Default:** `30s` |
| `--logDestination` | `STRING` | Write logs to a file. If not specified, write logs to `stdout`. |
| `--logFormat` | `STRING` | Choose log output format: `"fluent"`, `"text"`.<br><br>**Default:** `"text"` |
| `--metricsAddr` | `STRING` | A `host:port` on which to serve metrics and diagnostics. |
| `--metricsAddr` | `STRING` | A `host:port` on which to serve metrics and diagnostics. The metrics endpoint is `http://{host}:{port}/_/varz`. |
| `--parallelism` | `INT` | The number of concurrent database transactions to use.<br><br>**Default:** `16` |
| `--quiescentPeriod` | `DURATION` | How often to retry deferred mutations.<br><br>**Default:** `10s` |
| `--retireOffset` | `DURATION` | How long to delay removal of applied mutations.<br><br>**Default:** `24h0m0s` |
| `--scanSize` | `INT` | The number of rows to retrieve from the staging database used to store metadata for [replication modes](#fetch-mode).<br><br>**Default:** `10000` |
| `--schemaRefresh` | `DURATION` | How often a watcher will refresh its schema. If this value is zero or negative, refresh behavior will be disabled.<br><br>**Default:** `1m0s` |
| `--sourceConn` | `STRING` | The source database's connection string. |
| `--stageDisableCreateTableReaderIndex` | `BOOL` | Disable the creation of partial covering indexes to improve read performance on staging tables. Set to `true` if creating indexes on existing tables would cause a significant operational impact.<br><br>**Default:** `false` |
| `--stageDisableCreateTableReaderIndex` | `BOOL` | Disable the creation of partial covering indexes to improve read performance on staging tables. Set to `true` if creating indexes on existing tables would cause a significant operational impact.<br><br>**Default:** `false` |
| `--stageMarkAppliedLimit` | `INT` | Limit the number of mutations to be marked applied in a single statement.<br><br>**Default:** `100000` |
| `--stageSanityCheckPeriod` | `DURATION` | How often to validate staging table apply order (`-1` to disable).<br><br>**Default:** `10m0s` |
| `--stageSanityCheckWindow` | `DURATION` | How far back to look when validating staging table apply order.<br><br>**Default:** `1h0m0s` |
Expand Down
6 changes: 3 additions & 3 deletions src/current/molt/migrate-in-phases.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ The following example specifies that the `employees` table should be watched for
--non-interactive \
--mode replication-only \
--pglogical-replication-slot-name cdc_slot \
--replicator-flags '--metricsAddr: 30005'
--replicator-flags '--metricsAddr :30005'
~~~
</section>

Expand All @@ -128,12 +128,12 @@ The following example specifies that the `employees` table should be watched for
--table-filter 'employees' \
--non-interactive \
--mode replication-only \
--replicator-flags '--defaultGTIDSet 4c658ae6-e8ad-11ef-8449-0242ac140006:1-29 --metricsAddr: 30005'
--replicator-flags '--defaultGTIDSet 4c658ae6-e8ad-11ef-8449-0242ac140006:1-29 --metricsAddr :30005'
~~~
</section>

{{site.data.alerts.callout_info}}
`--metricsAddr` enables a Prometheus-compatible metrics endpoint (e.g., on port `30005`) where replication metrics will be served.
`--metricsAddr` enables a Prometheus-compatible metrics endpoint at `http://{host}:{port}/_/varz` where replication metrics will be served. In this example, the endpoint is `http://localhost:30005/_/varz`.
{{site.data.alerts.end}}

{% include molt/fetch-replication-output.md %}
Expand Down
6 changes: 3 additions & 3 deletions src/current/molt/migrate-to-cockroachdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Start the initial load of data into the target database. Continuous replication
--non-interactive \
--mode data-load-and-replication \
--pglogical-replication-slot-name cdc_slot \
--replicator-flags '--metricsAddr: 30005'
--replicator-flags '--metricsAddr :30005'
~~~
</section>

Expand All @@ -79,12 +79,12 @@ Start the initial load of data into the target database. Continuous replication
--table-handling truncate-if-exists \
--non-interactive \
--mode data-load-and-replication \
--replicator-flags '--metricsAddr: 30005'
--replicator-flags '--metricsAddr :30005'
~~~
</section>

{{site.data.alerts.callout_info}}
`--metricsAddr` enables a Prometheus-compatible metrics endpoint (e.g., on port `30005`) where replication metrics will be served.
`--metricsAddr` enables a Prometheus-compatible metrics endpoint at `http://{host}:{port}/_/varz` where replication metrics will be served. In this example, the endpoint is `http://localhost:30005/_/varz`.
{{site.data.alerts.end}}

{% include molt/fetch-data-load-output.md %}
Expand Down
5 changes: 4 additions & 1 deletion src/current/molt/molt-fetch.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ The following source databases are currently supported:

- PostgreSQL 11-16
- MySQL 5.7, 8.0 and later
- CockroachDB

## Installation

Expand Down Expand Up @@ -900,6 +899,10 @@ You can use the `cdc_cursor` value with an external change data capture (CDC) to

By default, MOLT Fetch exports [Prometheus](https://prometheus.io/) metrics at `127.0.0.1:3030/metrics`. You can configure this endpoint with the `--metrics-listen-addr` [flag](#global-flags).

{{site.data.alerts.callout_info}}
If [replication](#fetch-mode) is active, metrics from the `replicator` process are enabled by setting the `--metricsAddr` [replication flag](#replication-flags), and are served at `http://host:port/_/varz`.
{{site.data.alerts.end}}

Cockroach Labs recommends monitoring the following metrics:

| Metric Name | Description |
Expand Down
3 changes: 1 addition & 2 deletions src/current/molt/molt-verify.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@ For a demo of MOLT Verify, watch the following video:

## Supported databases

The following databases are currently supported:
The following source databases are currently supported:

- PostgreSQL 12-16
- MySQL 5.7, 8.0 and later
- CockroachDB

## Installation

Expand Down
Loading