Skip to content

Conversation

taroface
Copy link
Contributor

@taroface taroface commented Oct 1, 2025

DOC-13338
DOC-14748

This PR is still WIP.

Notes for reviewers:

Page Please review Notes
Load and Replicate entire flow, but focus on Replicator setup, usage, troubleshooting Fetch content is pre-existing
Migration Failback entire flow This was completely rewritten
Resume Replication Replicator usage, any missing context/caveats about resuming Structure is still rough
MOLT Replicator whole page Structure is WIP. Usage section is still barebones. I need to think about a good way to present the flags per dialect.
MOLT Fetch check for content that should be removed/moved to Replicator I think I caught everything, but may not understand something

Copy link

github-actions bot commented Oct 1, 2025

Files changed:

Copy link

netlify bot commented Oct 1, 2025

Deploy Preview for cockroachdb-api-docs canceled.

Name Link
🔨 Latest commit ee821ed
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-api-docs/deploys/68f7ddf4956c2a0008ff4163

Copy link

netlify bot commented Oct 1, 2025

Deploy Preview for cockroachdb-interactivetutorials-docs canceled.

Name Link
🔨 Latest commit ee821ed
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-interactivetutorials-docs/deploys/68f7ddf44382710008921a92

Copy link

netlify bot commented Oct 1, 2025

Deploy Preview for cockroachdb-docs failed. Why did it fail? →

Name Link
🔨 Latest commit ee821ed
🔍 Latest deploy log https://app.netlify.com/projects/cockroachdb-docs/deploys/68f7ddf4ac9b3300089a6435

@taroface taroface changed the title [wip] MOLT Replicator draft docs [WIP] MOLT Replicator draft docs Oct 1, 2025
Copy link

@ryanluu12345 ryanluu12345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent work @taroface . Not an easy doc to write, but you made it understandable and clean! Let's bottom out on some of these discussions and ensure the deprecation effort from @tuansydau reflects the reality of what we are documenting.


{% include molt/molt-setup.md %}

## Start Fetch

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So an important note here is that as part of the deprecation of the wrapper, we're mainly removing the invocations of Replicator from MOLT. However, there is some source database Replication setup that we'll still need to perform for PostgreSQL specifically. The reason we have to do this is because we need to create the slot at the time we actually do the snapshot export so we don't have gaps in data.

So that means that we still need to document the behavior when we set certain pg-* flags for setting publication, slots and the relevant drop/recreate behavior. I think we'll need to discuss this a bit more in the next team meeting to clearly lay out what the behavior still is. CC @tuansydau @Jeremyyang920

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taroface resolved here: #20465 (comment)

We resolved it during the call and Tuan's comment above should capture the behavior.

## Prepare the CockroachDB cluster

{{site.data.alerts.callout_success}}
For details on enabling CockroachDB changefeeds, refer to [Create and Configure Changefeeds]({% link {{ site.current_cloud_version }}/create-and-configure-changefeeds.md %}).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to also ensure that the license and organization are set:

SET CLUSTER SETTING cluster.organization = 'organization';
SET CLUSTER SETTING enterprise.license ='$LICENSE';

@noelcrl
Copy link
Contributor

noelcrl commented Oct 14, 2025

@taroface
For this section: https://www.cockroachlabs.com/docs/molt/migrate-data-load-replicate-only?filters=oracle#oracle-instant-client

We should also make the user grab their own copy of instant client from Oracle. For the Linux instructions, we should replace:

sudo apt-get install -yqq --no-install-recommends libaio1t64
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
curl -o /tmp/ora-libs.zip https://replicator.cockroachdb.com/third_party/instantclient-basiclite-linux-amd64.zip
unzip -d /tmp /tmp/ora-libs.zip
sudo mv /tmp/instantclient_21_13/* /usr/lib
export LD_LIBRARY_PATH=/usr/lib

With:

sudo apt-get install -yqq --no-install-recommends libaio1t64
sudo ln -s /usr/lib/x86_64-linux-gnu/libaio.so.1t64 /usr/lib/x86_64-linux-gnu/libaio.so.1
# Download the Oracle Instant Client libraries from Oracle: (https://www.oracle.com/ca-en/database/technologies/instant-client.html) into /tmp/instantclient-basiclite-linux-amd64.zip for example
unzip -d /tmp /tmp/instantclient-basiclite-linux-amd64.zip
sudo mv /tmp/instantclient_21_13/* /usr/lib
export LD_LIBRARY_PATH=/usr/lib

Let me know if you have questions on this, it should be updated for each instance of the oracle instant client instructions throughout the docs.

The actual links for Linux binaries:
Download from the Official Oracle site here (linux amd64) or here (linux x86).


MOLT Replicator offers three consistency modes for balancing throughput and transactional guarantees:

1. Consistent (default for CockroachDB sources): Preserves per-row order and source transaction atomicity. Concurrent transactions are controlled by `--parallelism`.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is implied since the immediate section implies immediate is the default for postgres, mysql, and oracle, but should we call out that consistent and best effort only apply to "CRDB sources" or "failback mode"?

@crash-overdrive
Copy link

Can we link the replicator dashboard in the DOCS?
Replicator Grafana dashboard
Replicator Grafana dashboard for Oracle

{% include_cached copy-clipboard.html %}
~~~ sql
-- Query the current SCN from Oracle
SELECT CURRENT_SCN FROM V$DATABASE;
Copy link

@ryanluu12345 ryanluu12345 Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@noelcrl , can you please check the Fetch cursor logging to see if we end up printing the relevant SCN that folks should start from? I think right now this is a good step for folks who are using replicator directly (querying the scn directly), but I'm wondering if we need to include this if folks are doing this via Fetch since it should be able to access the current SCN and log out.

CC @tuansydau

Copy link
Contributor

@noelcrl noelcrl Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is logged in dataexport/oracle.go:NewOracleSource() when starting Fetch:

logger.Info().Msgf(fmt.Sprintf("replication-only mode should include the following "+
			"replicator flags: --backfillFromSCN %s --scn %s", replicationBackfillSCN, scn))

The message should look like:

replication-only mode should include the following replicator flags: --backfillFromSCN 26685444 --scn 26685786

So if Fetch is being used for a bulk load, and this logic in Fetch isn't being removed, these SCNs can be used instead of doing all of these queries here to find it manually.

If just replication is necessary (no bulk data-load), the user can just grab the current SCN and just use it for both --backfillFromSCN and --scn

Copy link

@ryanluu12345 ryanluu12345 Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we may need to change the logging here. Maybe we put it as part of the cursor specific logging like we do for MySQL and Postgres. CC @tuansydau . Tuan can you work with Noel to figure out the best way to do this?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sure, I'll work with Noel on this

@taroface taroface requested a review from rohan-joshi October 20, 2025 16:29
@taroface taroface requested a review from florence-crl October 21, 2025 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants