diff --git a/src/current/_config_cockroachdb.yml b/src/current/_config_cockroachdb.yml index 7f625e5c764..2404f13d6f1 100644 --- a/src/current/_config_cockroachdb.yml +++ b/src/current/_config_cockroachdb.yml @@ -1,7 +1,7 @@ baseurl: /docs -current_cloud_version: v23.2 +current_cloud_version: v24.1 destination: _site/docs homepage_title: CockroachDB Docs versions: - stable: v23.2 + stable: v24.1 dev: v24.1 diff --git a/src/current/_data/cloud_releases.csv b/src/current/_data/cloud_releases.csv index 59283505e83..2e5067965b4 100644 --- a/src/current/_data/cloud_releases.csv +++ b/src/current/_data/cloud_releases.csv @@ -85,3 +85,4 @@ date,sha 2024-04-17,null 2024-04-18,null 2024-05-12,null +2024-05-20,null diff --git a/src/current/_data/redirects.yml b/src/current/_data/redirects.yml index 5df4a678b5c..e210ae50b86 100644 --- a/src/current/_data/redirects.yml +++ b/src/current/_data/redirects.yml @@ -79,12 +79,6 @@ # Pages undergoing maintenance -- destination: migration-overview.md - sources: - - migrate-from-oracle.md - temporary: true - versions: ['v21.2', 'v22.1', 'v22.2', 'v23.1'] - # Renamed pages - destination: admin-ui-overview.md diff --git a/src/current/_data/releases.yml b/src/current/_data/releases.yml index 1ca7564b790..776e4e1cba3 100644 --- a/src/current/_data/releases.yml +++ b/src/current/_data/releases.yml @@ -6068,3 +6068,37 @@ docker_arm_limited_access: false source: true previous_release: v24.1.0-rc.1 + +- release_name: v24.1.0 + major_version: v24.1 + release_date: '2024-05-20' + release_type: Production + cloud_only: true + cloud_only_message_short: 'Available in CockroachDB Dedicated. Self-hosted binaries available June 3, 2024 per the staged release process.' + cloud_only_message: > + CockroachDB v24.1 is now generally available for CockroachDB Dedicated, + and is scheduled to be made available for CockroachDB Self-Hosted on June 3, 2024 per the staged release process. + For more information, refer to + [Upgrade to CockroachDB v24.1](https://www.cockroachlabs.com/docs/cockroachcloud/upgrade-to-v24.1). To connect to a CockroachDB Dedicated cluster on v24.1, refer to [Connect to a CockroachDB Dedicated Cluster](https://www.cockroachlabs.com/docs/cockroachcloud/connect-to-your-cluster). + go_version: go1.22.0 + sha: 6205244e922606f85761dad2137b842f43a53716 + has_sql_only: true + has_sha256sum: true + mac: + mac_arm: true + mac_arm_experimental: true + mac_arm_limited_access: false + windows: true + linux: + linux_arm: true + linux_arm_experimental: false + linux_arm_limited_access: false + linux_intel_fips: true + linux_arm_fips: false + docker: + docker_image: cockroachdb/cockroach-unstable + docker_arm: true + docker_arm_experimental: false + docker_arm_limited_access: false + source: true + previous_release: v24.1.0-rc.2 diff --git a/src/current/_data/versions.csv b/src/current/_data/versions.csv index d0f53f49767..8de94d3dfd4 100644 --- a/src/current/_data/versions.csv +++ b/src/current/_data/versions.csv @@ -13,4 +13,4 @@ v22.1,2022-05-24,2023-05-24,2023-11-24,N/A,N/A,N/A,N/A,N/A,v21.2,release-22.1 v22.2,2022-12-05,2023-12-05,2024-06-05,N/A,N/A,N/A,N/A,N/A,v22.1,release-22.2 v23.1,2023-05-15,2024-05-15,2024-11-15,23.1.11,23.1.12,2023-11-13,2024-11-13,2025-11-13,v22.2,release-23.1 v23.2,2024-02-05,2025-02-05,2025-08-05,N/A,N/A,N/A,N/A,N/A,v23.1,release-23.2 -v24.1,N/A,N/A,N/A,N/A,N/A,N/A,N/A,N/A,v23.2,release-24.1 +v24.1,2024-05-20,2025-05-20,2025-11-20,N/A,N/A,N/A,N/A,N/A,v23.2,release-24.1 diff --git a/src/current/_includes/releases/cloud/2024-05-20.md b/src/current/_includes/releases/cloud/2024-05-20.md new file mode 100644 index 00000000000..dd64098ba83 --- /dev/null +++ b/src/current/_includes/releases/cloud/2024-05-20.md @@ -0,0 +1,19 @@ +# May 20, 2024 + +

General updates

+ +- CockroachDB v24.1 is now generally available for CockroachDB {{ site.data.products.dedicated }}, and is scheduled to be made available for CockroachDB {{ site.data.products.core }} on June 3, 2024{% comment %}Verify{% endcomment %}. For more information, refer to [Create a CockroachDB Dedicated Cluster]({% link cockroachcloud/create-your-cluster.md %}) or [Upgrade to CockroachDB v24.1]({% link cockroachcloud/upgrade-to-v24.1.md %}). +- CockroachDB {{ site.data.products.dedicated }} on AWS is now available in the `me-central-1`(United Arab Emirates) [ region]({% link cockroachcloud/regions.md %}#aws-regions). +- CockroachDB {{ site.data.products.dedicated }} on GCP is now available in new [regions]({% link cockroachcloud/regions.md %}#gcp-regions): + - `europe-southwest1` (Madrid) + - `europe-west8` (Milan) + - `europe-west12` (Paris) + - `me-central1` (Doha) + - `me-west1` (Tel Aviv) + - `us-east5` (Columbus) + - `us-south1` (Dallas) + +

Security updates

+ +- [Configuring private connectivity using Google Cloud Private Service Connect]({% link cockroachcloud/connect-to-your-cluster.md %}#gcp-private-service-connect) is available in [preview](https://www.cockroachlabs.com/docs/{{site.current_cloud_version}}/cockroachdb-feature-availability) for CockroachDB {{ site.data.products.dedicated }} clusters on GCP. [Private connectivity]({% link cockroachcloud/network-authorization.md %}#options-for-controlling-network-access) allows you to establish SQL access to a CockroachDB {{ site.data.products.dedicated }} cluster entirely through cloud provider private infrastructure, without exposing the cluster to the public internet, affording enhanced security and performance. + diff --git a/src/current/_includes/releases/v23.1/v23.1.0-beta.2.md b/src/current/_includes/releases/v23.1/v23.1.0-beta.2.md index 0e47c964ad1..7906b9dcf5b 100644 --- a/src/current/_includes/releases/v23.1/v23.1.0-beta.2.md +++ b/src/current/_includes/releases/v23.1/v23.1.0-beta.2.md @@ -30,7 +30,7 @@ Release Date: April 17, 2023

Performance improvements

-- Pubsub sink [changefeeds](https://www.cockroachlabs.com/docs/v23.1/create-changefeed) can now support higher throughputs by enabling the `changefeed.new_pubsub_sink_enabled` [cluster setting](https://www.cockroachlabs.com/docs/v23.1/cluster-settings). [#100930][#100930] +- Google Cloud Pub/Sub sink [changefeeds](https://www.cockroachlabs.com/docs/v23.1/create-changefeed) can now support higher throughputs by enabling the `changefeed.new_pubsub_sink_enabled` [cluster setting](https://www.cockroachlabs.com/docs/v23.1/cluster-settings). Enabling this setting will cause changefeeds to use a newer Pub/Sub sink, which uses capitalized top-level fields in the message: `{Key: ..., Value: ..., Topic: ...}`. As a result, you may need to reconfigure downstream systems to parse the new message format. If you do not enable `changefeed.new_pubsub_sink_enabled`, the top-level message fields remain all lowercase: `{key: ..., value: ..., topic: ...}`. [#100930][#100930]
diff --git a/src/current/_includes/releases/v23.1/v23.1.0.md b/src/current/_includes/releases/v23.1/v23.1.0.md index cd65a6571dc..bfff7511a04 100644 --- a/src/current/_includes/releases/v23.1/v23.1.0.md +++ b/src/current/_includes/releases/v23.1/v23.1.0.md @@ -224,7 +224,7 @@ Asyncpg is commonly used with ORM libraries such as SQLAlchemy to provide a simp -

Recovery and I/O

+

Recovery and I/O

Change data capture (Changefeeds)
diff --git a/src/current/_includes/releases/v23.1/v23.1.21.md b/src/current/_includes/releases/v23.1/v23.1.21.md index fc4d6200ddf..4c60598830f 100644 --- a/src/current/_includes/releases/v23.1/v23.1.21.md +++ b/src/current/_includes/releases/v23.1/v23.1.21.md @@ -8,7 +8,7 @@ Release Date: May 7, 2024 - The `FORCE_INVERTED_INDEX` hint causes the [optimizer]({% link v23.1/cost-based-optimizer.md %}) to prefer a query plan scan over any [inverted index]({% link v23.1/inverted-indexes.md %}) of the hinted table. An error is emitted if no such query plan can be generated. [#122301][#122301] - Introduced three new [cluster settings]({% link v23.1/cluster-settings.md %}) for controlling [table statistics]({% link v23.1/cost-based-optimizer.md %}#table-statistics) forecasting: - - [`sql.stats.forecasts.min_observations`]({% link v23.1/cluster-settings.md %}#setting-sql-stats-forecasts-min-observations) is the minimum number of observed statistics required to produce a forecast. + - [`sql.stats.forecasts.min_observations`]({% link v23.1/cluster-settings.md %}) is the minimum number of observed statistics required to produce a forecast. - [`sql.stats.forecasts.min_goodness_of_fit`]({% link v23.1/cluster-settings.md %}#setting-sql-stats-forecasts-min-goodness-of-fit) is the minimum R² (goodness of fit) measurement required from all predictive models to use a forecast. - [`sql.stats.forecasts.max_decrease`]({% link v23.1/cluster-settings.md %}#setting-sql-stats-forecasts-max-decrease) is the most a prediction can decrease, expressed as the minimum ratio of the prediction to the lowest prior observation. [#122990][#122990] - Added a [session variable]({% link v23.1/set-vars.md %}) `optimizer_use_improved_multi_column_selectivity_estimate`, which if enabled, causes the [optimizer]({% link v23.1/cost-based-optimizer.md %}) to use an improved selectivity estimate for multi-column predicates. This setting will default to `true` on v24.2 and later, and `false` on prior versions. [#123068][#123068] diff --git a/src/current/_includes/releases/v23.2/v23.2.0-alpha.1.md b/src/current/_includes/releases/v23.2/v23.2.0-alpha.1.md index ee50d8cf863..63ba4aaf471 100644 --- a/src/current/_includes/releases/v23.2/v23.2.0-alpha.1.md +++ b/src/current/_includes/releases/v23.2/v23.2.0-alpha.1.md @@ -11,6 +11,7 @@ Release Date: September 26, 2023 - When customizing the [SQL shell's interactive prompt]({% link v23.2/cockroach-sql.md %}), the special sequence `%M` now expands to the full host name instead of the combination of host name and port number. To include the port number explicitly, use `%>`. The special sequence `%m` now expands to the host name up to the first period. [#105137][#105137] - The [`cockroach debug zip`]({% link v23.2/cockroach-debug-zip.md %}) command stores data retrieved from SQL tables in the remote cluster using the TSV format by default. [#107474][#107474] - The [`changefeed.protect_timestamp.max_age` cluster setting]({% link v23.2/protect-changefeed-data.md %}) will only apply to newly created changefeeds in v23.2. For existing changefeeds, you can set the [`protect_data_from_gc_on_pause`]({% link v23.2/create-changefeed.md %}#protect-pause) option so that changefeeds do not experience infinite retries and accumulate protected change data. You can use the [`ALTER CHANGEFEED`]({% link v23.2/alter-changefeed.md %}) statement to add `protect_data_from_gc_on_pause` to existing changefeeds. [#103539][#103539] +- The `changefeed.new_pubsub_sink_enabled` cluster setting is now enabled by default, which improves changefeed throughput. With this setting enabled, the top-level fields in JSON-encoded messages are capitalized: `{Key: ..., Value: ..., Topic: ...}`. After upgrading to CockroachDB v23.2, you may need to reconfigure downstream systems to parse the new message format. If you disable this setting, changefeeds emitting to Pub/Sub sinks with JSON-encoded events have the top-level message fields all lowercase: `{key: ..., value: ..., topic: ...}`.

Security updates

diff --git a/src/current/_includes/releases/v24.1/v24.1.0-alpha.1.md b/src/current/_includes/releases/v24.1/v24.1.0-alpha.1.md index eeed1ab4764..02332ef2759 100644 --- a/src/current/_includes/releases/v24.1/v24.1.0-alpha.1.md +++ b/src/current/_includes/releases/v24.1/v24.1.0-alpha.1.md @@ -6,7 +6,7 @@ Release Date: March 7, 2024

Backward-incompatible changes

-- [`AS OF SYSTEM TIME`]({% link v23.2/as-of-system-time.md %}) queries can no longer use a timestamp followed by a question mark to signifiy a future-time value. This was an undocumented syntax. [#116830][#116830] +- [`AS OF SYSTEM TIME`]({% link v23.2/as-of-system-time.md %}) queries can no longer use a timestamp followed by a question mark to signify a future-time value. This was an undocumented syntax. [#116830][#116830]

{{ site.data.products.enterprise }} edition changes

diff --git a/src/current/_includes/releases/v24.1/v24.1.0-beta.3.md b/src/current/_includes/releases/v24.1/v24.1.0-beta.3.md index 0852831e401..c4bd4dc4f69 100644 --- a/src/current/_includes/releases/v24.1/v24.1.0-beta.3.md +++ b/src/current/_includes/releases/v24.1/v24.1.0-beta.3.md @@ -9,7 +9,7 @@ Release Date: April 30, 2024 - Updated the [`SHOW GRANTS`]({% link v24.1/show-grants.md %}) responses to display the `object_type` and `object_name`, which has replaced the `relation_name` column. [#122823][#122823] - Added [external connection]({% link v24.1/create-external-connection.md %}) granted privileges to the [`SHOW GRANTS`]({% link v24.1/show-grants.md %}) command. [#122823][#122823] - Introduced three new [cluster settings]({% link v24.1/cluster-settings.md %}) for controlling table statistics forecasting: - - [`sql.stats.forecasts.min_observations`]({% link v24.1/cluster-settings.md %}#setting-sql-stats-forecasts-min-observations) is the minimum number of observed statistics required to produce a forecast. + - [`sql.stats.forecasts.min_observations`]({% link v24.1/cluster-settings.md %}) is the minimum number of observed statistics required to produce a forecast. - [`sql.stats.forecasts.min_goodness_of_fit`]({% link v24.1/cluster-settings.md %}#setting-sql-stats-forecasts-min-goodness-of-fit) is the minimum R² (goodness of fit) measurement required from all predictive models to use a forecast. - [`sql.stats.forecasts.max_decrease`]({% link v24.1/cluster-settings.md %}#setting-sql-stats-forecasts-max-decrease) is the most a prediction can decrease, expressed as the minimum ratio of the prediction to the lowest prior observation. [#122459][#122459] diff --git a/src/current/_includes/releases/v24.1/v24.1.0.md b/src/current/_includes/releases/v24.1/v24.1.0.md index 5c9e947b332..b7931e5593d 100644 --- a/src/current/_includes/releases/v24.1/v24.1.0.md +++ b/src/current/_includes/releases/v24.1/v24.1.0.md @@ -1,6 +1,6 @@ ## v24.1.0 -Release Date: TBD TBD, 2024 +Release Date: May 20, 2024 With the release of CockroachDB v24.1, we've added new capabilities to help you migrate, build, and operate more efficiently. Refer to our summary of the most significant user-facing changes under [Feature Highlights](#v24-1-0-feature-highlights). @@ -11,12 +11,14 @@ With the release of CockroachDB v24.1, we've added new capabilities to help you This section summarizes the most significant user-facing changes in v24.1.0 and other features recently made available to CockroachDB users across versions. For a complete list of features and changes in v24.1, including bug fixes and performance improvements, refer to the [release notes]({% link releases/index.md %}#testing-releases) for previous v24.1 testing releases. You can also search the docs for sections labeled [New in v24.1](https://www.cockroachlabs.com/docs/search?query=new+in+v24.1). - **Feature categories** - - [Observability](#v24-1-0-observability) + - [Performance](#v24-1-0-performance) + - [Change data capture](#v24-1-0-change-data-capture) + - [Recovery](#v24-1-0-recovery) + - [Security](#v24-1-0-security) - [Migrations](#v24-1-0-migrations) - - [Security and compliance](#v24-1-0-security-and-compliance) - - [Disaster recovery](#v24-1-0-disaster-recovery) - - [Deployment and operations](#v24-1-0-deployment-and-operations) - [SQL](#v24-1-0-sql) + - [Operations](#v24-1-0-operations) + - [Observability](#v24-1-0-observability) - **Additional information** - [Backward-incompatible changes](#v24-1-0-backward-incompatible-changes) - [Deprecations](#v24-1-0-deprecations) @@ -29,7 +31,7 @@ In CockroachDB Self-Hosted, all available features are free to use unless their
-

Observability

+

Performance

@@ -44,22 +46,70 @@ In CockroachDB Self-Hosted, all available features are free to use unless their - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-

TBD

-

TBD

-
TBD{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-no.html %}
+

WAL (Write-Ahead Logging) Failover

+

When a CockroachDB node is configured to run with multiple stores, you can mitigate some effects of disk stalls by configuring the node to failover the store's write-ahead log (WAL) to another store's data directory.

+

This feature is in preview.

+
24.1{% include icon-yes.html %}{% include icon-no.html %}{% include icon-no.html %}
+

Autocommit DDL

+

In 24.1 we have added the autocommit_before_ddl session +variable. When set to true, any schema change statement that is sent +during an explicit transaction will cause the transaction to commit +before executing the schema change. +This setting can be used to improve compatibility with some tools that +do not work well due to our limitations with schema changes in explicit +transactions. It also can be used to use schema changes under READ +COMMITTED more easily, without needing to teach the schema changer about +READ COMMITTED.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Statistics for virtual computed columns

+

CockroachDB now collects statistics for virtual computed columns, making it possible to optimize query plans for tables that have these columns. Customers will see better query performance for queries that involve virtual computed columns.

+

For more information, you can also view a video demo.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Write Amplification Improvements

+

A number of Pebble improvements are now on by default, leading to a reduction in write amplification. Of particular note, a vast majority of range snapshots previously ingested into L0 are now ingested directly into L6 in the LSM, reducing write and read amplification with positive effects to node stability and SQL performance.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Increased SLA for multi-region Dedicated clusters

+

CockroachDB Dedicated multi-region clusters now offer a five-nines (99.999%) availability target.

+
All*{% include icon-no.html %}{% include icon-yes.html %}{% include icon-no.html %}
-

Migrations

- +

Change Data Capture

@@ -74,22 +124,60 @@ In CockroachDB Self-Hosted, all available features are free to use unless their - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-

TBD

-

TBD

-
TBD{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Improved performance for changefeeds at scale

+

Mux rangefeed is a subsystem that improves the performance of rangefeeds with scale. In v24.1, Mux rangefeeds are enabled by default.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Emit changefeed messages to an Azure Event Hub

+

Changefeeds can emit messages to an Azure Event Hub, which is compatible with Apache Kafka. You can use the Kafka changefeed and sink configuration options.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Google Cloud Pub/Sub sink for changefeeds is now generally available

+

The changefeed sink for Google Cloud Pub/Sub is GA.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Filter changefeed messages based on cluster, SQL session, or row-level TTL jobs

+

Use the disable_changefeed_replication session variable to prevent changefeeds from emitting messages for any changes during that session. Also in v24.1, you can enable the ignore_disable_changefeed_replication option to ignore the storage parameter or cluster setting that disables changefeed replication. These settings can be useful to manage multiple changefeed use cases on the same table.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Set Kafka quotas per changefeed

+

For Kafka sinks, implement a resource usage limit per changefeed by setting a client ID and quota in your Kafka server's configuration.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
-

Disaster recovery

- +

Recovery

@@ -104,22 +192,20 @@ In CockroachDB Self-Hosted, all available features are free to use unless their - - + - + - +
-

TBD

-

TBD.

+

Physical Cluster Replication is now generally available

+

Physical Cluster Replication is an asynchonous replication feature that allows your cluster to recover from full-cluster failure with a low RPO and RTO. In 24.1, it is a GA feature, requiring an Enterprise license, and only available for self-hosted CockroachDB deployments. For more information, refer to the Physical Cluster Replication overview and a blog post about Physical Cluster Replication.

TBD24.1 {% include icon-yes.html %} {% include icon-no.html %} {% include icon-no.html %}
-

Security and compliance

- +

Security

@@ -134,22 +220,65 @@ In CockroachDB Self-Hosted, all available features are free to use unless their - - + - + - + + + + + + + +
-

TBD

-

TBD

+

Private connectivity in CockroachDB Dedicated with Google Cloud Private Service Connect

+

Private connectivity using Private Service Connect is now available in preview for CockroachDB Dedicated clusters on GCP. For more information, refer to Establish Private Connectivity and a video about how to set it up.

TBDAll* {% include icon-no.html %} {% include icon-yes.html %} {% include icon-no.html %}
+

Support for matching against SUBJECT

+

When using certificate based authentication, CockroachDB now supports mapping of SQL user roles to values in the Subject field of the X.509 certificate used for TLS authentication.

+

Subject mapping is useful if: +

    +
  • You run your own Certificate Authority (CA) infrastructure.
  • +
  • You need to use your existing CA infrastructure to manage SQL user authentication.
  • +
  • You need to use the same CA for multiple CockroachDB clusters.
  • +
+

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-no.html %}
-

Deployment and operations

+

Migrations

+ + + + + + + + + + + + + + + + + + + + + + +
FeatureAvailability
Ver.Self-HostedDedicatedServerless
+

+

MOLT Fetch is GA. MOLT Fetch automatically imports data from a PostgreSQL, MySQL, or CockroachDB source to a target CockroachDB database. If the fetch process encounters an error, data import can be continued from the point where it was interrupted. MOLT Fetch can be configured to replicate ongoing changes on the source database to CockroachDB following the initial data load.

+
All*{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

SQL

@@ -164,22 +293,108 @@ In CockroachDB Self-Hosted, all available features are free to use unless their - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Stored Procedures and UDF Improvements

+

Support for PL/pgSQL, user-defined functions, and stored procedures is now expanded: +

+

For more information, you can also view a video demo.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

Read Committed Isolation in GA

+

Read Committed isolation is now GA. Under READ COMMITTED isolation, DDL operations can be auto-committed, and RETRY_SERIALIZABLE errors are absent. This offers a simpler migration path for applications and removes the need for client-side retry handling, which is necessary under SERIALIZABLE isolation.

+

For more information, you can also view a video about using Read Committed isolation and the blog post Isolation levels without the anomaly table.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

SELECT FOR SHARE updates

+

A shared lock that is acquired explicitly using SELECT FOR SHARE or implicitly by a read-committed transaction, can now be re-acquired with higher strength by either using a SELECT FOR UPDATE statement or by writing to the key.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

SHOW DEFAULT SESSION VARIABLES FOR ROLE

+

Previously, a database administrator could discover which session variables were set for a role only by switching into to that user or querying a system table. The new command SHOW DEFAULT SESSION VARIABLES FOR ROLE shows the database administrator the default values for session variables applied to a given user.

+
24.1{% include icon-yes.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+ +

Operations

+ + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + +
FeatureAvailability
Ver.Self-HostedDedicatedServerless
-

TBD

-

TBD

+

New Regions for CockroachDB Dedicated

+

Cockroach Cloud is now available in additional Azure regions. This expansion enhances our global reach and offers more options for deploying resilient, distributed databases with low latency and high availability.

+

With these new regions, you can now select a geographical location that best fits your needs, reducing data latency and ensuring compliance with regional data residency regulations. Deploying in a region close to your service or customers means improved performance and a better user experience.

TBDAll* {% include icon-no.html %} {% include icon-yes.html %} {% include icon-no.html %}
+

Organize Cloud clusters using Folders

+

Folders help users organize and manage access for Clusters by projects, teams or business units. This feature is now in public preview and available to all Cloud organizations. For additional details, refer to the release note.

+
All*{% include icon-no.html %}{% include icon-yes.html %}{% include icon-yes.html %}
+

CockroachDB Cloud Terraform provider IAM enhancements

+

The CockroachDB Cloud Terraform provider has new resources for User Role Grant and Service Accounts, and a new data source for Folders. These new features improve customers’ ability to manage secure access to data, API, and infrastructure on CockroachDB Cloud.

+
All*{% include icon-no.html %}{% include icon-yes.html %}{% include icon-yes.html %}
-

SQL

- +

Observability

@@ -194,17 +409,36 @@ In CockroachDB Self-Hosted, all available features are free to use unless their - - + - + - + + + + + + + + + + + + + + +
-

TBD

-

TBD

+

CockroachDB Dedicated supports a Prometheus-compatibile metric scrape endpoint.

+

The Prometheus-compatibile metric scrape endpoint for CockroachDB Dedicated is generally available.

TBDAll* {% include icon-no.html %} {% include icon-yes.html %} {% include icon-no.html %}
+

Export CockroachDB Dedicated metrics to Azure Monitor

+

CockroachDB Dedicated supports exporting metrics to Azure Monitor in limited access. Contact your Cockroach Labs account team for access.

+
All*{% include icon-no.html %}{% include icon-yes.html %}{% include icon-no.html %}
+

Export CockroachDB Dedicated logs to Azure Monitor

+

CockroachDB Dedicated supports exporting logs to Azure Monitor in limited access. Contact your Cockroach Labs account team for access.

+
All*{% include icon-no.html %}{% include icon-yes.html %}{% include icon-no.html %}
@@ -234,26 +468,45 @@ In CockroachDB Self-Hosted, all available features are free to use unless their -

Backward-incompatible changes

Before [upgrading to CockroachDB v24.1]({% link v24.1/upgrade-cockroach-version.md %}), be sure to review the following backward-incompatible changes, as well as [key cluster setting changes](#v24-1-0-cluster-settings), and adjust your deployment as necessary. -- TBD +- [`AS OF SYSTEM TIME`]({% link v24.1/as-of-system-time.md %}) queries can no longer use a timestamp followed by a question mark to signify a future-time value. This was an undocumented syntax. [#116830](https://github.com/cockroachdb/cockroach/pull/116830) +- The [`READ COMMITTED`]({% link v24.1/read-committed.md %}) isolation level now requires the cluster to have a valid [enterprise license](https://cockroachlabs.com/docs/v24.1/licensing-faqs#obtain-a-license). Otherwise, transactions which are configured to run as `READ COMMITTED` will be upgraded to [`SERIALIZABLE`]({% link v24.1/demo-serializable.md %}), as described in the next note. [#120154](https://github.com/cockroachdb/cockroach/pull/120154) +- The `sql.txn.read_committed_isolation.enabled` [cluster setting]({% link v24.1/cluster-settings.md %}) is now `true` by default. As a result for enterprise users, [`READ COMMITTED`]({% link v24.1/read-committed.md %}) transactions are **not** automatically upgraded to [`SERIALIZABLE`]({% link v24.1/demo-serializable.md %}), and will run as `READ COMMITTED` by default. On v23.2, refer to the [Upgrades of SQL Transaction Isolation Level](https://www.cockroachlabs.com/docs/v24.1/ui-sql-dashboard#upgrades-of-sql-transaction-isolation-level) graph in the DB Console to check whether any transaction is being upgraded from a weaker isolation level to `SERIALIZABLE`, and could therefore run differently on v24.1. [#118479](https://github.com/cockroachdb/cockroach/pull/118479)

Key Cluster Setting Changes

The following changes should be reviewed prior to upgrading. Default cluster settings will be used unless you have manually set a value for a setting. This can be confirmed by checking the `system.settings` table (`select * from system.settings`) to view the non-default settings. -- TBD +- `sql.txn.read_committed_isolation.enabled` is now `true` by default. When set to `true`, transactions use the `READ COMMITTED` isolation level if specified by `BEGIN`/`SET` commands. + - If the cluster setting is `false`, as was the default in v23.2, such `READ COMMITTED` transactions will instead run as `SERIALIZABLE`. + - To check whether any transactions are being upgraded to `SERIALIZABLE`, see the [**Upgrades of SQL Transaction Isolation Level**](https://www.cockroachlabs.com/docs/v24.1/ui-sql-dashboard#upgrades-of-sql-transaction-isolation-level) graph in the DB Console." +- The `changefeed.balance_range_distribution.enable` [cluster setting]({% link v24.1/cluster-settings.md %}) is now deprecated. Instead, use the new cluster setting `changefeed.default_range_distribution_strategy`. `changefeed.default_range_distribution_strategy='balanced_simple'` has the same effect as setting `changefeed.balance_range_distribution.enable=true`. It does not require `initial_scan='only'`, which was required by the old setting. [#115166][#115166] +- Added the [cluster setting]({% link v24.1/cluster-settings.md %}) `security.client_cert.subject_required.enabled` which enforces a mandatory requirement for the client certificate's role subject to be set. The subject can be defined through either the subject role option or by specifying the `root-cert-distinguished-name` and `node-cert-distinguished-name` properties. This setting applies to both RPC access and login via authCert. [#122368][#122368] +- The [cluster setting]({% link v24.1/cluster-settings.md %}) `sql.contention.record_serialization_conflicts.enabled` is now `on` by default. As a result, any [`40001` error]({% link v24.1/transaction-retry-error-reference.md %}) that contains conflicting transaction information will be recorded by the contention registry, improving the ability to troubleshoot. For more information, refer to the [Insights page]({% link v24.1/ui-insights-page.md %}) documentation. [#116664][#116664] +- The new [cluster setting]({% link v24.1/cluster-settings.md %}) `storage.sstable.compression_algorithm` configures the compression algorithm used when compressing sstable blocks. Supported values are: "snappy" and "zstd" [snappy = `1`, zstd = `2`]. Changing the default of snappy to zstd can result in substantial performance improvement, however, the effects this change may be highly dependent on the workload and data, so experimentation is recommended before enabling zstd in production environments. +- The new setting `storage.wal_failover.unhealthy_op_threshold` allows you to set the latency threshold at which a WAL (Write-Ahead Logging) write is considered unhealthy. When exceeded, the node will attempt to write WAL entries to a secondary store's volume. For more information, refer to [#120509][#120509] +- The new `server.max_open_transactions_per_gateway` [cluster setting]({% link v24.1/cluster-settings.md %}), when set to a non-negative value, allows only admin users to execute a query if the number of open transactions on the current gateway node is already at the configured limit. [#118781][#118781] +- The new `server.redact_sensitive_settings.enabled` [cluster setting](https://www.cockroachlabs.com/docs/v24.1/cluster-settings) (`false` by default), when set to `true`, redacts the values of the following settings in the output of `SHOW` commands or other introspection interfaces. In the future, newly-added sensitive cluster settings will be redacted as well. Users with the `MODIFYCLUSTERSETTING` [privilege](https://www.cockroachlabs.com/docs/v24.1/security-reference/authorization#managing-privileges) can always view the unredacted settings. [#117729][#117729] +- The new boolean changefeed option [`ignore_disable_changefeed_replication`](../v24.1/create-changefeed.html#ignore-disable-changefeed), when set to `true`, prevents the changefeed from filtering events even if CDC filtering is configured via the `disable_changefeed_replication` [session variable](../v24.1/session-variables.html), `sql.ttl.changefeed_replication.disabled` [cluster setting](../v24.1/cluster-settings.html), or the `ttl_disable_changefeed_replication` [table storage parameter](../v24.1/alter-table.html#table-storage-parameters). [#120255][#120255] +- The provisioned-rate field, if specified, +should no longer accept a disk-name or an optional bandwidth field. To +use the disk bandwidth constraint the store-spec must contain +`provisioned-rate=bandwidth=`, otherwise the cluster +setting `kvadmission.store.provisioned_bandwidth` will be used. When set to a non-zero value, this is used as the provisioned bandwidth (in bytes/s), for each store. It can be overridden on a per-store basis using the --store flag. Note that setting the provisioned bandwidth to a positive value may enable disk bandwidth based admission control, since `admission.disk_bandwidth_tokens.elastic.enabled` defaults to `true`. +- Removed in v24.1: + - `sql.show_ranges_deprecated_behavior.enabled` + - `sql.trace.session_eventlog.enabled` + - `changefeed.balance_range_distribution.enabled`

Deprecations

-{% comment %}TODO: Intro para? Each sibling section has one.{% endcomment %} - -- TBD +- `changefeed.balance_range_distribution.enable` is now deprecated. Instead, use the new [cluster setting]({% link v24.1/cluster-settings.md %}) `changefeed.default_range_distribution_strategy`. `changefeed.default_range_distribution_strategy='balanced_simple'` has the same effect as setting `changefeed.balance_range_distribution.enable=true`. It does not require `initial_scan='only'`, which was required by the old setting. [#115166][#115166] +- The `cockroach connect` command has been removed. This command was [deprecated]({% link releases/v23.2.md %}#v23-2-0-deprecations) in CockroachDB v23.2. [#113893][#113893]

Known limitations

@@ -263,7 +516,22 @@ For information about new and unresolved limitations in CockroachDB v24.1, with Resource | Topic | Description ---------------------+--------------------------------------------+------------- -Cockroach University | [Example link](https://example.com/course1)| Summary here -Cockroach University | [Example link](https://example.com/course2)| Summary here -Docs | [Example link](https://example.com/doc1) | Summary here -Docs | [Example link](https://example.com/doc2) | Summary here +Cockroach University | [Introduction to Distributed SQL and CockroachDB](https://university.cockroachlabs.com/courses/course-v1:crl+intro-to-distributed-sql-and-cockroachdb+self-paced/about) | This course introduces the core concepts behind distributed SQL databases and describes how CockroachDB fits into this landscape. You will learn what differentiates CockroachDB from both legacy SQL and NoSQL databases and how CockroachDB ensures consistent transactions without sacrificing scale and resiliency. You'll learn about CockroachDB's seamless horizontal scalability, distributed transactions with strict ACID guarantees, and high availability and resilience. +Cockroach University | [Practical First Steps with CockroachDB](https://university.cockroachlabs.com/courses/course-v1:crl+practical-first-steps-with-crdb+self-paced/about) | This course will give you the tools you need to get started with CockroachDB. During the course, you will learn how to spin up a cluster, use the Admin UI to monitor cluster activity, and use SQL shell to solve a set of hands-on exercises. +Cockroach University | [Enterprise Application Development with CockroachDB](https://university.cockroachlabs.com/courses/course-v1:crl+client-side-txn-handling+self-paced/about) | This course is the first in a series designed to equip you with best practices for mastering application-level (client-side) transaction management in CockroachDB. We'll dive deep on common differences between CockroachDB and legacy SQL databases and help you sidestep challenges you might encounter when migrating to CockroachDB from Oracle, PostgreSQL, and MySQL. +Cockroach University | [Building a Highly Resilient Multi-region Database using CockroachDB](https://university.cockroachlabs.com/courses/course-v1:crl+intro-to-resilience-in-multi-region+self-paced/about) | This course is part of a series introducing solutions to running low-latency, highly resilient applications for data-intensive workloads on CockroachDB. In this course we focus on surviving large-scale infrastructure failures like losing an entire cloud region without losing data during recovery. We’ll show you how to use CockroachDB survival goals in a multi-region cluster to implement a highly resilient database that survives node or network failures across multiple regions with zero data loss. +Docs | [Migration Overview](https://www.cockroachlabs.com/docs/v24.1/migration-overview) | This page summarizes the steps of migrating a database to CockroachDB, which include testing and updating your schema to work with CockroachDB, moving your data into CockroachDB, and testing and updating your application. +Docs | [Architecture Overview](https://www.cockroachlabs.com/docs/v24.1/architecture/overview) | This page provides a starting point for understanding the architecture and design choices that enable CockroachDB's scalability and consistency capabilities. +Docs | [SQL Feature Support](https://www.cockroachlabs.com/docs/v24.1/sql-feature-support) | The page summarizes the standard SQL features CockroachDB supports as well as common extensions to the standard. +Docs | [Change Data Capture Overview](https://www.cockroachlabs.com/docs/v24.1/change-data-capture-overview) | This page summarizes CockroachDB's data streaming capabilities. Change data capture (CDC) provides efficient, distributed, row-level changefeeds into a configurable sink for downstream processing such as reporting, caching, or full-text indexing. +Docs | [Backup Architecture](https://www.cockroachlabs.com/docs/v24.1/backup-architecture) | This page describes the backup job workflow with a high-level overview, diagrams, and more details on each phase of the job. + +[#115166]: https://github.com/cockroachdb/cockroach/pull/115166 +[#113893]: https://github.com/cockroachdb/cockroach/pull/113893 +[#115166]: https://github.com/cockroachdb/cockroach/pull/115166 +[#122368]: https://github.com/cockroachdb/cockroach/pull/122368 +[#116664]: https://github.com/cockroachdb/cockroach/pull/116664 +[#120509]: https://github.com/cockroachdb/cockroach/pull/120509 +[#118781]: https://github.com/cockroachdb/cockroach/pull/118781 +[#117729]: https://github.com/cockroachdb/cockroach/pull/117729 +[#120255]: https://github.com/cockroachdb/cockroach/pull/120255 diff --git a/src/current/_includes/sidebar-data-v23.2.json b/src/current/_includes/sidebar-data-v23.2.json index f2aedcaf392..85e0a95ba8a 100644 --- a/src/current/_includes/sidebar-data-v23.2.json +++ b/src/current/_includes/sidebar-data-v23.2.json @@ -22,5 +22,6 @@ {% include_cached v23.2/sidebar-data/sql.json %}, {% include_cached v23.2/sidebar-data/reference.json %}, {% include_cached v23.2/sidebar-data/faqs.json %}, + {% include_cached v23.2/sidebar-data/releases.json %}, {% include_cached sidebar-data-cockroach-university.json %} ] diff --git a/src/current/_includes/sidebar-releases.json b/src/current/_includes/sidebar-releases.json index 26a6c95da8a..351e4192850 100644 --- a/src/current/_includes/sidebar-releases.json +++ b/src/current/_includes/sidebar-releases.json @@ -7,7 +7,7 @@ {% assign v_test = site.data.versions | where_exp: "v_test", "v_test.release_date == 'N/A'" | sort: "release_date" | last | map: "major_version" %} {% comment %} v_test iterates through the list of major versions in _data/versions.csv and returns the single latest testing version (if the release date is in the future or not otherwise specified). It's possible there is no testing release (in between GA of a version and the first alpha of the following version). {% endcomment %} { - "title": "CockroachDB Releases", + "title": "CockroachDB", "items": [ { "title": "Latest Production Release", @@ -20,7 +20,7 @@ "urls": [ "/releases/{{ site.versions["dev"] }}.html" ] - },{% endunless %} + }{% endunless %}, { "title": "All Releases", "urls": [ @@ -35,12 +35,15 @@ ] }, {% endfor %} + {% if v_test[0] %} {% comment %} check if a testing version is available {% endcomment %} { - "title": "Staged Release Process", + "title": "Latest Testing Release", "urls": [ - "/releases/staged-release-process.html" + {% comment %} check if a testing version is available and pull the latest testing version {% endcomment %} + "/releases/{{ v_test[0] }}.html" ] }, + {% endif %} { "title": "Release Support Policy", "urls": [ @@ -55,25 +58,25 @@ } ] }, -{% assign advisories = site.pages | where_exp: "advisories", "advisories.path contains 'advisories'" | where_exp: "advisories", "advisories.index != 'true'" %} -{ - "title": "Technical Advisories", - "urls": [ - "/advisories/index.html" - {% for x in advisories %} - ,"{{ x.url }}" - {% endfor %} - ] -}, { - "title": "Cloud Releases", + "title": "CockroachDB Cloud", "urls": [ "/releases/cloud.html" ] }, { - "title": "Kubernetes Operator", + "title": "CockroachDB Kubernetes Operator", "urls": [ "/releases/kubernetes-operator.html" ] +}, +{% assign advisories = site.pages | where_exp: "advisories", "advisories.path contains 'advisories'" | where_exp: "advisories", "advisories.index != 'true'" %} +{ + "title": "Technical Advisories", + "urls": [ + "/advisories/index.html" + {% for x in advisories %} + ,"{{ x.url }}" + {% endfor %} + ] } diff --git a/src/current/_includes/v23.1/cdc/pubsub-performance-setting.md b/src/current/_includes/v23.1/cdc/pubsub-performance-setting.md index f6b55402846..86ebed03a76 100644 --- a/src/current/_includes/v23.1/cdc/pubsub-performance-setting.md +++ b/src/current/_includes/v23.1/cdc/pubsub-performance-setting.md @@ -1,3 +1,3 @@ {{site.data.alerts.callout_info}} -{% include_cached new-in.html version="v23.1" %} Enable the `changefeed.new_pubsub_sink_enabled` [cluster setting]({% link {{ page.version.version }}/cluster-settings.md %}) to improve the throughput of changefeeds emitting to {% if page.name == "changefeed-sinks.md" %} Pub/Sub sinks. {% else %} [Pub/Sub sinks]({% link {{ page.version.version }}/changefeed-sinks.md %}#google-cloud-pub-sub). {% endif %} +{% include_cached new-in.html version="v23.1" %} Enable the `changefeed.new_pubsub_sink_enabled` [cluster setting]({% link {{ page.version.version }}/cluster-settings.md %}) to improve the throughput of changefeeds emitting to [Pub/Sub sinks]({% link {{ page.version.version }}/changefeed-sinks.md %}#google-cloud-pub-sub). Enabling this setting also alters the message format to use capitalized top-level fields in changefeeds emitting JSON-encoded messages to a Pub/Sub sink. For more details, refer to the [Pub/Sub sink messages]({% link {{ page.version.version }}/changefeed-sinks.md %}#pub-sub-sink-messages) section. {{site.data.alerts.end}} \ No newline at end of file diff --git a/src/current/_includes/v23.1/sidebar-data/migrate.json b/src/current/_includes/v23.1/sidebar-data/migrate.json index 949b2754d81..92a72d90371 100644 --- a/src/current/_includes/v23.1/sidebar-data/migrate.json +++ b/src/current/_includes/v23.1/sidebar-data/migrate.json @@ -9,7 +9,7 @@ ] }, { - "title": "Migration Tools", + "title": "MOLT Tools", "items": [ { "title": "Schema Conversion Tool", @@ -18,7 +18,7 @@ ] }, { - "title": "MOLT Verify", + "title": "Verify", "urls": [ "/${VERSION}/molt-verify.html" ] @@ -28,7 +28,12 @@ "urls": [ "/${VERSION}/live-migration-service.html" ] - }, + } + ] + }, + { + "title": "Third-Party Migration Tools", + "items": [ { "title": "AWS DMS", "urls": [ @@ -120,6 +125,12 @@ "/${VERSION}/migrate-from-mysql.html" ] }, + { + "title": "Migrate from Oracle", + "urls": [ + "/${VERSION}/migrate-from-oracle.html" + ] + }, { "title": "Migration Strategy: Lift and Shift", "urls": [ diff --git a/src/current/_includes/v23.2/sidebar-data/migrate.json b/src/current/_includes/v23.2/sidebar-data/migrate.json index 9b87e0c2f31..5b6338a628b 100644 --- a/src/current/_includes/v23.2/sidebar-data/migrate.json +++ b/src/current/_includes/v23.2/sidebar-data/migrate.json @@ -9,7 +9,7 @@ ] }, { - "title": "Migration Tools", + "title": "MOLT Tools", "items": [ { "title": "Schema Conversion Tool", @@ -18,13 +18,13 @@ ] }, { - "title": "MOLT Fetch", + "title": "Fetch", "urls": [ "/${VERSION}/molt-fetch.html" ] }, { - "title": "MOLT Verify", + "title": "Verify", "urls": [ "/${VERSION}/molt-verify.html" ] @@ -34,7 +34,12 @@ "urls": [ "/${VERSION}/live-migration-service.html" ] - }, + } + ] + }, + { + "title": "Third-Party Migration Tools", + "items": [ { "title": "AWS DMS", "urls": [ @@ -126,6 +131,12 @@ "/${VERSION}/migrate-from-mysql.html" ] }, + { + "title": "Migrate from Oracle", + "urls": [ + "/${VERSION}/migrate-from-oracle.html" + ] + }, { "title": "Migration Strategy: Lift and Shift", "urls": [ diff --git a/src/current/_includes/v23.2/sidebar-data/releases.json b/src/current/_includes/v23.2/sidebar-data/releases.json index 8ee555fdc9a..fb49f7c9acc 100644 --- a/src/current/_includes/v23.2/sidebar-data/releases.json +++ b/src/current/_includes/v23.2/sidebar-data/releases.json @@ -1,5 +1,5 @@ { - "title": "Releases", + "title": "CockroachDB Releases", "is_top_level": true, "items": [ {% include_cached sidebar-all-releases.json %} diff --git a/src/current/_includes/v24.1/known-limitations/plpgsql-datatype-limitations.md b/src/current/_includes/v24.1/known-limitations/plpgsql-datatype-limitations.md deleted file mode 100644 index 229120607e2..00000000000 --- a/src/current/_includes/v24.1/known-limitations/plpgsql-datatype-limitations.md +++ /dev/null @@ -1,7 +0,0 @@ -- `RECORD` parameters and variables are not supported in [user-defined functions]({% link {{ page.version.version }}/user-defined-functions.md %}). [#105713](https://github.com/cockroachdb/cockroach/issues/105713) -- Variable shadowing (e.g., declaring a variable with the same name in an inner block) is not supported in PL/pgSQL. [#117508](https://github.com/cockroachdb/cockroach/issues/117508) -- Syntax for accessing members of composite types without parentheses is not supported. [#114687](https://github.com/cockroachdb/cockroach/issues/114687) -- `NOT NULL` variable declarations are not supported. [#105243](https://github.com/cockroachdb/cockroach/issues/105243) -- Cursors opened in PL/pgSQL execute their queries on opening, affecting performance and resource usage. [#111479](https://github.com/cockroachdb/cockroach/issues/111479) -- Cursors in PL/pgSQL cannot be declared with arguments. [#117746](https://github.com/cockroachdb/cockroach/issues/117746) -- `OPEN FOR EXECUTE` is not supported for opening cursors. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) \ No newline at end of file diff --git a/src/current/_includes/v24.1/known-limitations/plpgsql-feature-limitations.md b/src/current/_includes/v24.1/known-limitations/plpgsql-feature-limitations.md deleted file mode 100644 index 953bb475587..00000000000 --- a/src/current/_includes/v24.1/known-limitations/plpgsql-feature-limitations.md +++ /dev/null @@ -1,9 +0,0 @@ -- PL/pgSQL arguments cannot be referenced with ordinals (e.g., `$1`, `$2`). [#114701](https://github.com/cockroachdb/cockroach/issues/114701) -- The following statements are not supported: - - `FOR` loops, including `FOR` cursor loops, `FOR` query loops, and `FOREACH` loops. [#105246](https://github.com/cockroachdb/cockroach/issues/105246) - - `RETURN NEXT` and `RETURN QUERY`. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) - - `PERFORM`, `EXECUTE`, `GET DIAGNOSTICS`, and `CASE`. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) -- PL/pgSQL exception blocks cannot catch [transaction retry errors]({% link {{ page.version.version }}/transaction-retry-error-reference.md %}). [#111446](https://github.com/cockroachdb/cockroach/issues/111446) -- `RAISE` statements cannot be annotated with names of schema objects related to the error (i.e., using `COLUMN`, `CONSTRAINT`, `DATATYPE`, `TABLE`, or `SCHEMA`). [#106237](https://github.com/cockroachdb/cockroach/issues/106237) -- `RAISE` statements message the client directly, and do not produce log output. [#117750](https://github.com/cockroachdb/cockroach/issues/117750) -- `ASSERT` debugging checks are not supported. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) \ No newline at end of file diff --git a/src/current/_includes/v24.1/known-limitations/plpgsql-limitations.md b/src/current/_includes/v24.1/known-limitations/plpgsql-limitations.md new file mode 100644 index 00000000000..70b66dbd6a1 --- /dev/null +++ b/src/current/_includes/v24.1/known-limitations/plpgsql-limitations.md @@ -0,0 +1,20 @@ +{% if page.name != "known-limitations.md" # New limitations in v24.1 %} +- It is not possible to use a variable as a target more than once in the same `INTO` clause. For example, `SELECT 1, 2 INTO x, x;`. [#121605](https://github.com/cockroachdb/cockroach/issues/121605) +- PLpgSQL variable declarations cannot inherit the type of a table row or column using `%TYPE` or `%ROWTYPE` syntax. [#114676](https://github.com/cockroachdb/cockroach/issues/114676) +{% endif %} +- PL/pgSQL arguments cannot be referenced with ordinals (e.g., `$1`, `$2`). [#114701](https://github.com/cockroachdb/cockroach/issues/114701) +- The following statements are not supported: + - `FOR` loops, including `FOR` cursor loops, `FOR` query loops, and `FOREACH` loops. [#105246](https://github.com/cockroachdb/cockroach/issues/105246) + - `RETURN NEXT` and `RETURN QUERY`. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) + - `PERFORM`, `EXECUTE`, `GET DIAGNOSTICS`, and `CASE`. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) +- PL/pgSQL exception blocks cannot catch [transaction retry errors]({% link {{ page.version.version }}/transaction-retry-error-reference.md %}). [#111446](https://github.com/cockroachdb/cockroach/issues/111446) +- `RAISE` statements cannot be annotated with names of schema objects related to the error (i.e., using `COLUMN`, `CONSTRAINT`, `DATATYPE`, `TABLE`, or `SCHEMA`). [#106237](https://github.com/cockroachdb/cockroach/issues/106237) +- `RAISE` statements message the client directly, and do not produce log output. [#117750](https://github.com/cockroachdb/cockroach/issues/117750) +- `ASSERT` debugging checks are not supported. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) +- `RECORD` parameters and variables are not supported in [user-defined functions]({% link {{ page.version.version }}/user-defined-functions.md %}). [#105713](https://github.com/cockroachdb/cockroach/issues/105713) +- Variable shadowing (e.g., declaring a variable with the same name in an inner block) is not supported in PL/pgSQL. [#117508](https://github.com/cockroachdb/cockroach/issues/117508) +- Syntax for accessing members of composite types without parentheses is not supported. [#114687](https://github.com/cockroachdb/cockroach/issues/114687) +- `NOT NULL` variable declarations are not supported. [#105243](https://github.com/cockroachdb/cockroach/issues/105243) +- Cursors opened in PL/pgSQL execute their queries on opening, affecting performance and resource usage. [#111479](https://github.com/cockroachdb/cockroach/issues/111479) +- Cursors in PL/pgSQL cannot be declared with arguments. [#117746](https://github.com/cockroachdb/cockroach/issues/117746) +- `OPEN FOR EXECUTE` is not supported for opening cursors. [#117744](https://github.com/cockroachdb/cockroach/issues/117744) \ No newline at end of file diff --git a/src/current/_includes/v24.1/known-limitations/read-committed-limitations.md b/src/current/_includes/v24.1/known-limitations/read-committed-limitations.md index e9d4c899293..5087e29ac00 100644 --- a/src/current/_includes/v24.1/known-limitations/read-committed-limitations.md +++ b/src/current/_includes/v24.1/known-limitations/read-committed-limitations.md @@ -3,4 +3,5 @@ - Multi-column-family checks during updates are not supported under `READ COMMITTED` isolation. [#112488](https://github.com/cockroachdb/cockroach/issues/112488) - Because locks acquired by [foreign key]({% link {{ page.version.version }}/foreign-key.md %}) checks, [`SELECT FOR UPDATE`]({% link {{ page.version.version }}/select-for-update.md %}), and [`SELECT FOR SHARE`]({% link {{ page.version.version }}/select-for-update.md %}) are fully replicated under `READ COMMITTED` isolation, some queries experience a delay for Raft replication. - [Foreign key]({% link {{ page.version.version }}/foreign-key.md %}) checks are not performed in parallel under `READ COMMITTED` isolation. -- [`SELECT FOR UPDATE` and `SELECT FOR SHARE`]({% link {{ page.version.version }}/select-for-update.md %}) statements are less optimized under `READ COMMITTED` isolation than under `SERIALIZABLE` isolation. Under `READ COMMITTED` isolation, `SELECT FOR UPDATE` and `SELECT FOR SHARE` usually perform an extra lookup join for every locked table when compared to the same queries under `SERIALIZABLE`. In addition, some optimization steps (such as de-correlation of correlated [subqueries]({% link {{ page.version.version }}/subqueries.md %})) are not currently performed on these queries. \ No newline at end of file +- [`SELECT FOR UPDATE` and `SELECT FOR SHARE`]({% link {{ page.version.version }}/select-for-update.md %}) statements are less optimized under `READ COMMITTED` isolation than under `SERIALIZABLE` isolation. Under `READ COMMITTED` isolation, `SELECT FOR UPDATE` and `SELECT FOR SHARE` usually perform an extra lookup join for every locked table when compared to the same queries under `SERIALIZABLE`. In addition, some optimization steps (such as de-correlation of correlated [subqueries]({% link {{ page.version.version }}/subqueries.md %})) are not currently performed on these queries. +- Regardless of isolation level, [`SELECT FOR UPDATE` and `SELECT FOR SHARE`]({% link {{ page.version.version }}/select-for-update.md %}) statements in CockroachDB do not prevent insertion of new rows matching the search condition (i.e., [phantom reads]({% link {{ page.version.version }}/read-committed.md %}#non-repeatable-reads-and-phantom-reads)). This matches PostgreSQL behavior at all isolation levels. [#120673](https://github.com/cockroachdb/cockroach/issues/120673) \ No newline at end of file diff --git a/src/current/_includes/v24.1/known-limitations/routine-limitations.md b/src/current/_includes/v24.1/known-limitations/routine-limitations.md new file mode 100644 index 00000000000..f122a76f25f --- /dev/null +++ b/src/current/_includes/v24.1/known-limitations/routine-limitations.md @@ -0,0 +1,7 @@ +{% if page.name != "known-limitations.md" # New limitations in v24.1 %} +- Routines cannot be invoked with named arguments, e.g., `SELECT foo(a => 1, b => 2);` or `SELECT foo(b := 1, a := 2);`. [#122264](https://github.com/cockroachdb/cockroach/issues/122264) +- Routines cannot be created if they reference temporary tables. [#121375](https://github.com/cockroachdb/cockroach/issues/121375) +- Routines cannot be created with unnamed `INOUT` parameters. For example, `CREATE PROCEDURE p(INOUT INT) AS $$ BEGIN NULL; END; $$ LANGUAGE PLpgSQL;`. [#121251](https://github.com/cockroachdb/cockroach/issues/121251) +- Routines cannot be created if they return fewer columns than declared. For example, `CREATE FUNCTION f(OUT sum INT, INOUT a INT, INOUT b INT) LANGUAGE SQL AS $$ SELECT (a + b, b); $$;`. [#121247](https://github.com/cockroachdb/cockroach/issues/121247) +{% endif %} +- DDL statements (e.g., `CREATE TABLE`, `CREATE INDEX`) are not allowed within UDFs or stored procedures. [#110080](https://github.com/cockroachdb/cockroach/issues/110080) \ No newline at end of file diff --git a/src/current/_includes/v24.1/known-limitations/stored-proc-limitations.md b/src/current/_includes/v24.1/known-limitations/stored-proc-limitations.md new file mode 100644 index 00000000000..ec0fa31c9b8 --- /dev/null +++ b/src/current/_includes/v24.1/known-limitations/stored-proc-limitations.md @@ -0,0 +1,2 @@ +{% if page.name != "known-limitations.md" # New limitations in v24.1 %} +{% endif %} \ No newline at end of file diff --git a/src/current/_includes/v24.1/known-limitations/udf-stored-proc-limitations.md b/src/current/_includes/v24.1/known-limitations/udf-limitations.md similarity index 75% rename from src/current/_includes/v24.1/known-limitations/udf-stored-proc-limitations.md rename to src/current/_includes/v24.1/known-limitations/udf-limitations.md index 0ff2a43cd90..7064acb8775 100644 --- a/src/current/_includes/v24.1/known-limitations/udf-stored-proc-limitations.md +++ b/src/current/_includes/v24.1/known-limitations/udf-limitations.md @@ -1,13 +1,9 @@ -{% if page.name != "stored-procedures.md" %} +{% if page.name != "known-limitations.md" # New limitations in v24.1 %} +- A `RECORD`-returning UDF cannot be created without a `RETURN` statement in the root block, which would restrict the wildcard type to a concrete one. [#122945](https://github.com/cockroachdb/cockroach/issues/122945) +{% endif %} - User-defined functions are not currently supported in: - Expressions (column, index, constraint) in tables. [#87699](https://github.com/cockroachdb/cockroach/issues/87699) - Views. [#87699](https://github.com/cockroachdb/cockroach/issues/87699) - User-defined functions cannot call themselves recursively. [#93049](https://github.com/cockroachdb/cockroach/issues/93049) - [Common table expressions]({% link {{ page.version.version }}/common-table-expressions.md %}) (CTE), recursive or non-recursive, are not supported in [user-defined functions]({% link {{ page.version.version }}/user-defined-functions.md %}) (UDF). That is, you cannot use a `WITH` clause in the body of a UDF. [#92961](https://github.com/cockroachdb/cockroach/issues/92961) -- The `setval` function cannot be resolved when used inside UDF bodies. [#110860](https://github.com/cockroachdb/cockroach/issues/110860) -{% endif %} - -{% if page.name != "user-defined-functions.md" %} -{% endif %} - -- DDL statements (e.g., `CREATE TABLE`, `CREATE INDEX`) are not allowed within UDFs or stored procedures. [#110080](https://github.com/cockroachdb/cockroach/issues/110080) +- The `setval` function cannot be resolved when used inside UDF bodies. [#110860](https://github.com/cockroachdb/cockroach/issues/110860) \ No newline at end of file diff --git a/src/current/_includes/v24.1/misc/force-index-selection.md b/src/current/_includes/v24.1/misc/force-index-selection.md index beeb1bcceac..a2f70c98ee6 100644 --- a/src/current/_includes/v24.1/misc/force-index-selection.md +++ b/src/current/_includes/v24.1/misc/force-index-selection.md @@ -6,34 +6,34 @@ Index selection can impact [performance]({% link {{ page.version.version }}/perf ##### Force index scan -The syntax to force a scan of a specific index is: +To force a scan of a specific index: {% include_cached copy-clipboard.html %} ~~~ sql -> SELECT * FROM table@my_idx; +SELECT * FROM table@my_idx; ~~~ This is equivalent to the longer expression: {% include_cached copy-clipboard.html %} ~~~ sql -> SELECT * FROM table@{FORCE_INDEX=my_idx}; +SELECT * FROM table@{FORCE_INDEX=my_idx}; ~~~ ##### Force reverse scan -The syntax to force a reverse scan of a specific index is: +To force a reverse scan of a specific index: {% include_cached copy-clipboard.html %} ~~~ sql -> SELECT * FROM table@{FORCE_INDEX=my_idx,DESC}; +SELECT * FROM table@{FORCE_INDEX=my_idx,DESC}; ~~~ -Forcing a reverse scan is sometimes useful during [performance tuning]({% link {{ page.version.version }}/performance-best-practices-overview.md %}). For reference, the full syntax for choosing an index and its scan direction is +Forcing a reverse scan can help with [performance tuning]({% link {{ page.version.version }}/performance-best-practices-overview.md %}). To choose an index and its scan direction: {% include_cached copy-clipboard.html %} ~~~ sql -SELECT * FROM table@{FORCE_INDEX=idx[,DIRECTION]} +SELECT * FROM table@{FORCE_INDEX=idx[,DIRECTION]}; ~~~ where the optional `DIRECTION` is either `ASC` (ascending) or `DESC` (descending). @@ -44,14 +44,14 @@ You can verify that the optimizer is choosing your desired scan direction using {% include_cached copy-clipboard.html %} ~~~ sql -> CREATE TABLE kv (K INT PRIMARY KEY, v INT); +CREATE TABLE kv (K INT PRIMARY KEY, v INT); ~~~ you can check the scan direction with: {% include_cached copy-clipboard.html %} ~~~ sql -> EXPLAIN (opt) SELECT * FROM users@{FORCE_INDEX=primary,DESC}; +EXPLAIN (opt) SELECT * FROM users@{FORCE_INDEX=primary,DESC}; ~~~ ~~~ @@ -62,6 +62,21 @@ you can check the scan direction with: (2 rows) ~~~ +#### Force inverted index scan + +To force a scan of any [inverted index]({% link {{ page.version.version }}/inverted-indexes.md %}) of the hinted table: + +{% include_cached copy-clipboard.html %} +~~~ sql +SELECT * FROM table@{FORCE_INVERTED_INDEX}; +~~~ + +The `FORCE_INVERTED_INDEX` hint does not allow specifying an inverted index. If no query plan can be generated, the query will result in the error: + +~~~ +ERROR: could not produce a query plan conforming to the FORCE_INVERTED_INDEX hint +~~~ + ##### Force partial index scan To force a [partial index scan]({% link {{ page.version.version }}/partial-indexes.md %}), your statement must have a `WHERE` clause that implies the partial index filter. diff --git a/src/current/_includes/v24.1/misc/session-vars.md b/src/current/_includes/v24.1/misc/session-vars.md index a8be2430bcd..7b0e8441a9d 100644 --- a/src/current/_includes/v24.1/misc/session-vars.md +++ b/src/current/_includes/v24.1/misc/session-vars.md @@ -51,6 +51,7 @@ | `optimizer_use_lock_op_for_serializable` | If `on`, the optimizer uses a `Lock` operator to construct query plans for `SELECT` statements using the [`FOR UPDATE` and `FOR SHARE`]({% link {{ page.version.version }}/select-for-update.md %}) clauses. This setting only affects `SERIALIZABLE` transactions. `READ COMMITTED` transactions are evaluated with the `Lock` operator regardless of the setting. | `off` | Yes | Yes | | `optimizer_use_multicol_stats` | If `on`, the optimizer uses collected multi-column statistics for cardinality estimation. | `on` | No | Yes | | `optimizer_use_not_visible_indexes` | If `on`, the optimizer uses not visible indexes for planning. | `off` | No | Yes | +| `optimizer_use_virtual_computed_column_stats` | If `on`, the optimizer uses table statistics on [virtual computed columns]({% link {{ page.version.version }}/computed-columns.md %}#virtual-computed-columns). | `on` | Yes | Yes | `plpgsql_use_strict_into` | If `on`, PL/pgSQL [`SELECT ... INTO` and `RETURNING ... INTO` statements]({% link {{ page.version.version }}/plpgsql.md %}#assign-a-result-to-a-variable) behave as though the `STRICT` option is specified. This causes the SQL statement to error if it does not return exactly one row. | `off` | Yes | Yes | | `pg_trgm.similarity_threshold` | The threshold above which a [`%`]({% link {{ page.version.version }}/functions-and-operators.md %}#operators) string comparison returns `true`. The value must be between `0` and `1`. For more information, see [Trigram Indexes]({% link {{ page.version.version }}/trigram-indexes.md %}). | `0.3` | Yes | Yes | | `prefer_lookup_joins_for_fks` | If `on`, the optimizer prefers [`lookup joins`]({% link {{ page.version.version }}/joins.md %}#lookup-joins) to [`merge joins`]({% link {{ page.version.version }}/joins.md %}#merge-joins) when performing [`foreign key`]({% link {{ page.version.version }}/foreign-key.md %}) checks. | `off` | Yes | Yes | diff --git a/src/current/_includes/v24.1/physical-replication/fast-cutback-syntax.md b/src/current/_includes/v24.1/physical-replication/fast-cutback-syntax.md index 1c217be5af0..4b468429d92 100644 --- a/src/current/_includes/v24.1/physical-replication/fast-cutback-syntax.md +++ b/src/current/_includes/v24.1/physical-replication/fast-cutback-syntax.md @@ -2,7 +2,7 @@ {% include_cached copy-clipboard.html %} ~~~ sql -ALTER VIRTUAL CLUSTER {original_primary_vc} START REPLICATION FROM {promoted_standby_vc} ON {connection_string_standby}; +ALTER VIRTUAL CLUSTER {original_primary_vc} START REPLICATION OF {promoted_standby_vc} ON {connection_string_standby}; ~~~ The original primary virtual cluster may be almost up to date with the promoted standby's virtual cluster. The difference in data between the two virtual clusters will include only the writes that have been applied to the promoted standby after cutover from the primary cluster. \ No newline at end of file diff --git a/src/current/_includes/v24.1/sidebar-data/latest-releases.json b/src/current/_includes/v24.1/sidebar-data/latest-releases.json index e69de29bb2d..e25f8c0fa7a 100644 --- a/src/current/_includes/v24.1/sidebar-data/latest-releases.json +++ b/src/current/_includes/v24.1/sidebar-data/latest-releases.json @@ -0,0 +1,7 @@ +{ + "title": "Latest Releases", + "is_top_level": true, + "items": [ + {% include_cached sidebar-latest-releases.json %} + ] + } diff --git a/src/current/_includes/v24.1/sidebar-data/migrate.json b/src/current/_includes/v24.1/sidebar-data/migrate.json index 9b87e0c2f31..5b6338a628b 100644 --- a/src/current/_includes/v24.1/sidebar-data/migrate.json +++ b/src/current/_includes/v24.1/sidebar-data/migrate.json @@ -9,7 +9,7 @@ ] }, { - "title": "Migration Tools", + "title": "MOLT Tools", "items": [ { "title": "Schema Conversion Tool", @@ -18,13 +18,13 @@ ] }, { - "title": "MOLT Fetch", + "title": "Fetch", "urls": [ "/${VERSION}/molt-fetch.html" ] }, { - "title": "MOLT Verify", + "title": "Verify", "urls": [ "/${VERSION}/molt-verify.html" ] @@ -34,7 +34,12 @@ "urls": [ "/${VERSION}/live-migration-service.html" ] - }, + } + ] + }, + { + "title": "Third-Party Migration Tools", + "items": [ { "title": "AWS DMS", "urls": [ @@ -126,6 +131,12 @@ "/${VERSION}/migrate-from-mysql.html" ] }, + { + "title": "Migrate from Oracle", + "urls": [ + "/${VERSION}/migrate-from-oracle.html" + ] + }, { "title": "Migration Strategy: Lift and Shift", "urls": [ diff --git a/src/current/_includes/v24.1/sidebar-data/releases.json b/src/current/_includes/v24.1/sidebar-data/releases.json index 18f2a1b7c6a..fb49f7c9acc 100644 --- a/src/current/_includes/v24.1/sidebar-data/releases.json +++ b/src/current/_includes/v24.1/sidebar-data/releases.json @@ -1,7 +1,7 @@ { - "title": "Releases", + "title": "CockroachDB Releases", "is_top_level": true, "items": [ - {% include_cached sidebar-releases.json %} + {% include_cached sidebar-all-releases.json %} ] } diff --git a/src/current/_includes/v24.1/ui/jobs.md b/src/current/_includes/v24.1/ui/jobs.md index 95b709a0b33..b7796f14bea 100644 --- a/src/current/_includes/v24.1/ui/jobs.md +++ b/src/current/_includes/v24.1/ui/jobs.md @@ -8,9 +8,7 @@ The Jobs list is designed for you to manage pending work. It is not intended to Use the **Jobs** table to see recently created and completed jobs. -The following screenshot shows `BACKUP` jobs: - -DB Console Jobs Page +DB Console Jobs Page ### Filter jobs @@ -34,10 +32,7 @@ Job ID | Unique job ID. This value is used to [pause]({{ link_prefix }}pause-job User Name | User that created the job. Creation Time (UTC) | Date and time the job was created. Last Modified Time (UTC) | Date and time the job was last modified. -Last Execution Time (UTC) | Date and time the job was last executed. -High-water Timestamp | A checkpoint for a [changefeed job's progress]({{ link_prefix }}monitor-and-debug-changefeeds.html#monitor-a-changefeed) that guarantees that all changes before (or at) the timestamp have been emitted. Hover over the high-water timestamp to view the [system time]({{ link_prefix }}as-of-system-time.html). -Execution Count | Number of times the job was executed. -Coordinator Node | ID of the coordinating node. +Completed Time (UTC) | Date and time the job was completed. To view [job details](#job-details), click the job description. @@ -56,7 +51,7 @@ Status | Description `REVERTING`| Job failed or was canceled and its changes are being reverted. `REVERT-FAILED` | Job encountered a non-retryable error when reverting the changes. It is necessary to manually clean up a job with this status. `RETRYING` | Job is retrying another job that failed. - + ## Job details The details show: diff --git a/src/current/cockroachcloud/aws-privatelink.md b/src/current/cockroachcloud/aws-privatelink.md index 97159f551b3..c093ce2808f 100644 --- a/src/current/cockroachcloud/aws-privatelink.md +++ b/src/current/cockroachcloud/aws-privatelink.md @@ -23,7 +23,7 @@ AWS PrivateLink for CockroachDB {{ site.data.products.serverless }} is in **[lim
{{site.data.alerts.callout_success}} -You must configure the AWS PrivateLink connection for your CockroachDB {{ site.data.products.dedicated }} cluster in CockroachDB {{ site.data.products.cloud }} and in AWS. For CockroachDB {{ site.data.products.cloud }}, you can use the CockroachDB {{ site.data.products.cloud }} Console, [Cloud API]({% link cockroachcloud/cloud-api.md %}) or [Terraform Provider]({% link cockroachcloud/provision-a-cluster-with-terraform.md %}). For help, refer to [Establish VPC Peering or AWS PrivateLink]({% link cockroachcloud/connect-to-your-cluster.md %}#establish-gcp-vpc-peering-or-aws-privatelink). +You must configure the AWS PrivateLink connection for your CockroachDB {{ site.data.products.dedicated }} cluster in CockroachDB {{ site.data.products.cloud }} and in AWS. For CockroachDB {{ site.data.products.cloud }}, you can use the CockroachDB {{ site.data.products.cloud }} Console, [Cloud API]({% link cockroachcloud/cloud-api.md %}) or [Terraform Provider]({% link cockroachcloud/provision-a-cluster-with-terraform.md %}). For help, refer to [Establish private connectivity]({% link cockroachcloud/connect-to-your-cluster.md %}#establish-private-connectivity). If you have multiple clusters, you will have to repeat these steps for each cluster that you want to connect to using AWS PrivateLink. {{site.data.alerts.end}} diff --git a/src/current/cockroachcloud/cockroachdb-dedicated-on-azure.md b/src/current/cockroachcloud/cockroachdb-dedicated-on-azure.md index 916e6ef5eb1..0107e57e013 100644 --- a/src/current/cockroachcloud/cockroachdb-dedicated-on-azure.md +++ b/src/current/cockroachcloud/cockroachdb-dedicated-on-azure.md @@ -21,11 +21,6 @@ CockroachDB {{ site.data.products.dedicated }} clusters on Azure have the follow - Azure Private Link is not yet available. [IP Allowlisting]({% link cockroachcloud/network-authorization.md %}#ip-allowlisting) allows you to restrict the IP addresses that can connect to your cluster. -### Observability - -- Exporting metrics to Azure Monitor is not yet available. To express interest, contact your Cockroach Labs account team. -- [Log Export]({% link cockroachcloud/export-logs.md %}) is not yet available. - ### Other features [PCI-Ready]({% link cockroachcloud/pci-dss.md %}) features are not yet available on Azure. To express interest, contact your Cockroach Labs account team. diff --git a/src/current/cockroachcloud/connect-to-your-cluster.md b/src/current/cockroachcloud/connect-to-your-cluster.md index 49bff1c4731..af311f45cd1 100644 --- a/src/current/cockroachcloud/connect-to-your-cluster.md +++ b/src/current/cockroachcloud/connect-to-your-cluster.md @@ -21,8 +21,8 @@ By default, CockroachDB {{ site.data.products.dedicated }} clusters are locked d - Allowed IP address ranges on the internet. - Cloud-provider-specific peer networking options: - - Google Cloud Platform (GCP) VPC Peering - - Amazon Web Services (AWS) Private link + - Google Cloud Platform (GCP) VPC Peering or Private Service Connect (Preview) + - Amazon Web Services (AWS) Privatelink {{site.data.alerts.callout_info}} Removing or adding an authorized network on your CockroachDB {{ site.data.products.dedicated }} cluster may take a few seconds to take effect. @@ -36,15 +36,19 @@ Removing or adding an authorized network on your CockroachDB {{ site.data.produc 1. Click **Apply**. -### Establish GCP VPC Peering or AWS PrivateLink + +### Establish private connectivity -GCP VPC Peering and AWS PrivateLink allow customers to establish SQL access to their clusters entirely through cloud provider private infrastructure, without exposure to the public internet, affording enhanced security and performance. +Private connectivity allows you to establish SQL access to a CockroachDB {{ site.data.products.dedicated }} cluster entirely through cloud provider private infrastructure, without exposing the cluster to the public internet, affording enhanced security and performance. -VPC peering is available only for GCP clusters, and AWS PrivateLink is available for AWS clusters. +- Clusters deployed on GCP can connect privately using [GCP Private Service Connect (PSC)](#gcp-private-service-connect) or [GCP VPC peering](#gcp-vpc-peering). PSC allows you to selectively connect your cluster to a VPC within your Google Cloud project, while VPC Peering allows you to connect the Cockroach Cloud's VPC for your cluster to a VPC within your Google Cloud project. +- Clusters deployed on AWS can connect privately using AWS PrivateLink, which allows you to connect Cockroach Cloud's VPC to a VPC within your AWS account. -To configure VPC Peering or PrivateLink, you create the private connection in your cloud provider, then configure your cluster to allow connections from your VPC or private endpoint. For more information, refer to [Network Authorization for CockroachDB {{ site.data.products.dedicated }} clusters: GCP VPC Peering]({% link cockroachcloud/network-authorization.md %}#vpc-peering) and [Network Authorization for CockroachDB {{ site.data.products.dedicated }} clusters: AWS PrivateLink]({% link cockroachcloud/network-authorization.md %}#aws-privatelink). +For more information, refer to [Network authorization]({% link cockroachcloud/network-authorization.md %}). -AWS PrivateLink can be configured only after the cluster is created. For detailed instructions, refer to [Managing AWS PrivateLink for a cluster]({% link cockroachcloud/aws-privatelink.md %}). To configure VPC Peering, continue to the [VPC Peering](#vpc-peering) section below. +{{site.data.alerts.callout_success}} +GCP Private Service Connect and AWS PrivateLink can be configured only after a cluster is created. +{{site.data.alerts.end}} Azure Private Link is not yet available for [CockroachDB {{ site.data.products.dedicated }} on Azure]({% link cockroachcloud/cockroachdb-dedicated-on-azure.md %}). @@ -52,7 +56,37 @@ Azure Private Link is not yet available for [CockroachDB {{ site.data.products.d {% include cockroachcloud/cdc/kafka-vpc-limitation.md %} {{site.data.alerts.end}} -#### VPC Peering +#### GCP Private Service Connect + +{{site.data.alerts.callout_info}} +{% include_cached feature-phases/preview.md %} +{{site.data.alerts.end}} + +1. Navigate to your cluster's **Networking > Private endpoint** tab. +1. Click **Add a private endpoint**. Copy the value provided for **Target service**. Do not close this browser window. +1. In a new browser window, log in to Google Cloud Console, go to **Private Service Connect** section, and create a new endpoint in the same VPC as your application. For details, refer to [Create an endpoint](https://cloud.google.com/vpc/docs/configure-private-service-connect-services#create-endpoint) in the Google Cloud documentation. + - Set **Target** to **Published service**. + - Set **Target service** to the value you copied from CockroachDB {{ site.data.products.cloud }} Console. If the endpoint's configured target service does not match, validation will fail. + - Provide a value for **Endpoint name**. This is not used by CockroachDB {{ site.data.products.cloud }}. + - If it is not enabled, enable the Service Directory API, click **Enable global access*, and create a namespace in each region where your cluster is deployed. + - Click **Add endpoint**. + - After the endpoint is created, copy the connection ID. +1. Return to the CockroachDB {{ site.data.products.cloud }} Console browser tab and click **Validate**. +1. Enter the endpoint's ID, then click **Validate**. CockroachDB {{ site.data.products.cloud }} attempts to connect to the endpoint's VPC and verifies that the target service matches the cluster. If validation fails, verify the endpoint's configuration, then try again. After validation succeeds, click **Complete** to finish creating the connection. +1. On the **Networking > Private endpoint** tab, verify that the connection status is **Available**. + +{{site.data.alerts.callout_success}} +After validation succeeds for an endpoint, additional endpoints in the same VPC are automatically automatically accepted if they are configured with the cluster's target service ID. Additional VPCs must be added separately. +{{site.data.alerts.end}} + +If you remove the endpoint from GCP or change its target service, the endpoint will be removed from the cluster automatically. + +After the connection is established, you can use it to [connect to your cluster](#connect-to-your-cluster). + + +#### GCP VPC Peering + +For GKE, we recommend deploying your application to a VPC-native cluster that uses [alias IP addresses](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips). If you are connecting from a [routes-based GKE cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/routes-based-cluster) instead, you must [export custom routes](https://cloud.google.com/vpc/docs/vpc-peering#importing-exporting-routes). CockroachDB {{ site.data.products.cloud }} will import your custom routes by default. 1. Navigate to your cluster's **Networking > VPC Peering** tab. 1. Click **Set up a VPC peering connection**. @@ -63,6 +97,15 @@ Azure Private Link is not yet available for [CockroachDB {{ site.data.products.d 1. Run the command displayed on the **Accept VPC peering connection request** window using [Google Cloud Shell](https://cloud.google.com/shell) or using the [gcloud command-line tool](https://cloud.google.com/sdk/gcloud). 1. On the **Networking** page, verify the connection status is **Available**. +After the connection is established, you can use it to [connect to your cluster](#connect-to-your-cluster). + +{{site.data.alerts.callout_info}} +Self-service VPC peering setup is not supported for CockroachDB {{ site.data.products.dedicated }} clusters deployed before March 5, 2020. If your cluster was deployed before March 5, 2020, you will have to [create a new cluster]({% link cockroachcloud/create-your-cluster.md %}) with VPC peering enabled, then [export your data]({% link cockroachcloud/use-managed-service-backups.md %}) from the old cluster to the new cluster. If your cluster was deployed on or after March 5, 2020, it will be locked into CockroachDB {{ site.data.products.dedicated }}'s default IP range (`172.28.0.0/14`) unless you explicitly configured a different IP range during cluster creation. +{{site.data.alerts.end}} + +#### AWS PrivateLink + +To establish an AWS PrivateLink connection, refer to [Managing AWS PrivateLink for a cluster]({% link cockroachcloud/aws-privatelink.md %}). After the connection is established, you can use it to [connect to your cluster](#connect-to-your-cluster). ## Connect to your cluster @@ -70,7 +113,7 @@ Azure Private Link is not yet available for [CockroachDB {{ site.data.products.d The **Setup** page of the **Connect to cluster** dialog displays. -1. If you set up a private connection, click **AWS PrivateLink** (for clusters deployed in AWS) or **VPC Peering** (for clusters deployed in GCP) to connect privately. Otherwise, click **IP Allowlist**. +1. If you have set up a private connection, select it to connect privately. Otherwise, click **IP Allowlist**. 1. Select the **SQL User**. If you have only one SQL user, it is automatically selected. {{site.data.alerts.callout_info}} diff --git a/src/current/cockroachcloud/create-your-cluster.md b/src/current/cockroachcloud/create-your-cluster.md index 9eb7f25ea07..26d994468b5 100644 --- a/src/current/cockroachcloud/create-your-cluster.md +++ b/src/current/cockroachcloud/create-your-cluster.md @@ -58,11 +58,16 @@ Select the region(s) and number of nodes for your cluster: Click **Next: Capacity**. -## Step 4. Enable VPC Peering (optional) + +## Step 4. Enable GCP VPC Peering (optional) -You can use [VPC peering]({% link cockroachcloud/network-authorization.md %}#vpc-peering) to connect a GCP application to a CockroachDB {{ site.data.products.cloud }} cluster deployed on GCP. A separate VPC Peering connection is required for each cluster. +You can use [GCP VPC peering]({% link cockroachcloud/network-authorization.md %}#gcp-vpc-peering) to establish a private connection between a GCP application and a CockroachDB {{ site.data.products.dedicated }} cluster deployed on GCP. A separate VPC Peering connection is required for each cluster. -VPC peering is only available for GCP clusters. For clusters deployed on AWS, you can [set up AWS PrivateLink]({% link cockroachcloud/network-authorization.md %}#aws-privatelink) after creating your cluster. [Azure Virtual Network Peering](https://learn.microsoft.com/azure/virtual-network/virtual-network-peering-overview) is not yet supported. Refer to [CockroachDB {{ site.data.products.dedicated }} on Azure]({% link cockroachcloud/cockroachdb-dedicated-on-azure.md %}). +If you don't want to enable VPC Peering, leave the default selection of **Use the default IP range** as is and click **Next: Capacity**. + +{{site.data.alerts.callout_success}} +You can [set up GCP Private Service Connect (Preview)]({% link cockroachcloud/connect-to-your-cluster.md %}#gcp-private-service-connect) instead of VPC peering after creating your cluster. +{{site.data.alerts.end}} You can use CockroachDB {{ site.data.products.cloud }}'s default IP range and size (`172.28.0.0/14`) as long as it doesn't overlap with the IP ranges in your network. Alternatively, you can configure the IP range: @@ -78,9 +83,7 @@ You can use CockroachDB {{ site.data.products.cloud }}'s default IP range and si 1. Click **Next: Capacity**. - Once your cluster is created, see [Establish VPC Peering or AWS PrivateLink]({% link cockroachcloud/connect-to-your-cluster.md %}#establish-gcp-vpc-peering-or-aws-privatelink) to finish setting up VPC Peering for your cluster. - -If you don't want to enable VPC Peering, leave the default selection of **Use the default IP range** as is and click **Next: Capacity**. + After your cluster is created, refer to [Establish private connectivity]({% link cockroachcloud/connect-to-your-cluster.md %}#gcp-vpc-peering) to finish setting up VPC Peering for your cluster. ## Step 5. Configure cluster capacity diff --git a/src/current/cockroachcloud/export-logs.md b/src/current/cockroachcloud/export-logs.md index c01a1d532d1..5cd9bd90518 100644 --- a/src/current/cockroachcloud/export-logs.md +++ b/src/current/cockroachcloud/export-logs.md @@ -6,7 +6,7 @@ docs_area: manage cloud: true --- -CockroachDB {{ site.data.products.dedicated }} users can use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) to configure log export to [AWS CloudWatch](https://aws.amazon.com/cloudwatch/) or [GCP Cloud Logging](https://cloud.google.com/logging). Once the export is configured, logs will flow from all nodes in all regions of your CockroachDB {{ site.data.products.dedicated }} cluster to your chosen cloud log sink. You can configure log export to redact sensitive log entries, limit log output by severity, send log entries to specific log group targets by log channel, among others. +CockroachDB {{ site.data.products.dedicated }} users can use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) to configure log export to [AWS CloudWatch](https://aws.amazon.com/cloudwatch/), [GCP Cloud Logging](https://cloud.google.com/logging), or [Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/logs/data-platform-logs). Once the export is configured, logs will flow from all nodes in all regions of your CockroachDB {{ site.data.products.dedicated }} cluster to your chosen cloud log sink. You can configure log export to redact sensitive log entries, limit log output by severity, send log entries to specific log group targets by log channel, among others. ## The `logexport` endpoint @@ -29,7 +29,7 @@ Method | Description -------|------------ `GET` | Returns the current status of the log export configuration. `POST` | Enables log export, or updates an existing log export configuration. -`DELETE` | Disables log export, halting all log export to AWS CloudWatch or GCP Cloud Logging. +`DELETE` | Disables log export, halting all log export to AWS CloudWatch, GCP Cloud Logging, or Azure Monitor. ## Log name format @@ -52,6 +52,7 @@ Where:
+
@@ -370,6 +371,14 @@ Perform the following steps to enable log export from your CockroachDB {{ site.d
+
+ +{{site.data.alerts.callout_info}} +Exporting Logs to Azure Monitor from a CockroachDB {{ site.data.products.dedicated }} cluster is in **[limited access](https://www.cockroachlabs.com/docs/{{ site.current_cloud_version }}/cockroachdb-feature-availability)** and is only available to enrolled organizations. To enroll your organization, contact your Cockroach Labs account team. This feature is subject to change. +{{site.data.alerts.end}} + +
+ {{site.data.alerts.callout_info}} Once log export has been enabled, logs generated going forward are sent to the specified cloud sink. Logs are not back-filled to the specified cloud sink. {{site.data.alerts.end}} @@ -412,7 +421,7 @@ Where: ## Limitations -- CockroachDB {{ site.data.products.dedicated }} clusters hosted on AWS can only export logs to AWS CloudWatch. Similarly, CockroachDB {{ site.data.products.dedicated }} clusters hosted on GCP can only export logs to GCP Cloud Logging. +- CockroachDB {{ site.data.products.dedicated }} clusters hosted on AWS can only export logs to AWS CloudWatch. Similarly, CockroachDB {{ site.data.products.dedicated }} clusters hosted on GCP can only export logs to GCP Cloud Logging, and CockroachDB {{ site.data.products.dedicated }} clusters hosted on Azure can only export logs to Azure Monitor. ## CockroachDB {{ site.data.products.dedicated }} log export Frequently Asked Questions (FAQ) @@ -426,7 +435,7 @@ Yes, use the custom log configuration step for your cloud provider, and specify ### Is it possible to send logs from one cloud provider to another? -No, if your CockroachDB {{ site.data.products.dedicated }} cluster resides on AWS, you can only export your logs to AWS CloudWatch. Similarly, if your CockroachDB {{ site.data.products.dedicated }} cluster resides on GCP, you can only export your logs to GCP Cloud Logging. +No, if your CockroachDB {{ site.data.products.dedicated }} cluster resides on AWS, you can only export your logs to AWS CloudWatch. Similarly, if your CockroachDB {{ site.data.products.dedicated }} cluster resides on GCP, you can only export your logs to GCP Cloud Logging, and if your CockroachDB {{ site.data.products.dedicated }} cluster resides on Azure, you can only export your logs to Azure Monitor. ### For a multi-region cluster, are the logs from all regions exported to one cloud log sink region? diff --git a/src/current/cockroachcloud/export-metrics.md b/src/current/cockroachcloud/export-metrics.md index 7be4eb9c976..cefbf03e92a 100644 --- a/src/current/cockroachcloud/export-metrics.md +++ b/src/current/cockroachcloud/export-metrics.md @@ -6,17 +6,13 @@ docs_area: manage cloud: true --- -CockroachDB {{ site.data.products.dedicated }} users can use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) to configure metrics export to [AWS CloudWatch](https://aws.amazon.com/cloudwatch/), [Datadog](https://www.datadoghq.com/), or [Prometheus](https://prometheus.io/). Once the export is configured, metrics will flow from all nodes in all regions of your CockroachDB {{ site.data.products.dedicated }} cluster to your chosen cloud metrics sink. +CockroachDB {{ site.data.products.dedicated }} users can use the [Cloud API]({% link cockroachcloud/cloud-api.md %}) to configure metrics export to [AWS CloudWatch](https://aws.amazon.com/cloudwatch/), [Datadog](https://www.datadoghq.com/), [Prometheus](https://prometheus.io/), or [Azure Monitor](https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/data-platform-metrics). Once the export is configured, metrics will flow from all nodes in all regions of your CockroachDB {{ site.data.products.dedicated }} cluster to your chosen cloud metrics sink. {{site.data.alerts.callout_success}} To export metrics from a CockroachDB {{ site.data.products.core }} cluster, refer to [Monitoring and Alerting](https://www.cockroachlabs.com/docs/{{site.current_cloud_version}}/monitoring-and-alerting) instead of this page. {{site.data.alerts.end}} -Exporting metrics to AWS CloudWatch is only available on CockroachDB {{ site.data.products.dedicated }} clusters which are hosted on AWS. Metrics export to Datadog and Prometheus is supported on all CockroachDB {{ site.data.products.dedicated }} clusters. - -{{site.data.alerts.callout_info}} -{% include_cached feature-phases/preview.md %} -{{site.data.alerts.end}} +Exporting metrics to AWS CloudWatch is only available on CockroachDB {{ site.data.products.dedicated }} clusters that are hosted on AWS. Exporting metrics to Azure Monitor is only available on CockroachDB {{ site.data.products.dedicated }} clusters that are hosted on Azure. Metrics export to Datadog and Prometheus is supported on all CockroachDB {{ site.data.products.dedicated }} clusters. @@ -26,9 +22,10 @@ To configure and manage metrics export for your CockroachDB {{ site.data.product Cloud metrics sink | Metrics export endpoint ------------------ | ---------------------------------------------------- -AWS Cloudwatch | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/cloudwatch` +AWS CloudWatch | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/cloudwatch` Datadog | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/datadog` Prometheus | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/prometheus` +Azure Monitor | `https://cockroachlabs.cloud/api/v1/clusters/{your_cluster_id}/metricexport/azuremonitor` Access to the `metricexport` endpoints requires a valid CockroachDB {{ site.data.products.cloud }} [service account]({% link cockroachcloud/managing-access.md %}#manage-service-accounts) with the appropriate permissions (`admin` privilege, Cluster Administrator role, or Cluster Operator role). @@ -38,7 +35,7 @@ Method | Required permissions | Description --- | --- | --- `GET` | `ADMIN`, `EDIT`, or `READ` | Returns the current status of the metrics export configuration. `POST` | `ADMIN` or `EDIT` | Enables metrics export, or updates an existing metrics export configuration. -`DELETE` | `ADMIN` | Disables metrics export, halting all metrics export to AWS CloudWatch, Datadog, or Prometheus. +`DELETE` | `ADMIN` | Disables metrics export, halting all metrics export to AWS CloudWatch, Datadog, Prometheus, or Azure Monitor. See [Service accounts]({% link cockroachcloud/managing-access.md %}#manage-service-accounts) for instructions on configuring a service account with these required permissions. @@ -48,11 +45,16 @@ See [Service accounts]({% link cockroachcloud/managing-access.md %}#manage-servi +
-Exporting metrics to AWS CloudWatch is only available on CockroachDB {{ site.data.products.dedicated }} clusters which are hosted on AWS. If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead. +{{site.data.alerts.callout_info}} +{% include_cached feature-phases/preview.md %} +{{site.data.alerts.end}} + +Exporting metrics to AWS CloudWatch is only available on CockroachDB {{ site.data.products.dedicated }} clusters that are hosted on AWS. If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on Azure, you can export metrics to [Azure Monitor]({% link cockroachcloud/export-metrics.md %}?filters=azure-monitor-metrics-export). If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on GCP, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead. {{site.data.alerts.callout_info}} Enabling metrics export will send around 250 metrics per node to AWS CloudWatch. Review the [AWS CloudWatch documentation](https://aws.amazon.com/cloudwatch/pricing/) to gauge how this adds to your AWS CloudWatch spend. @@ -166,6 +168,10 @@ Perform the following steps to enable metrics export from your CockroachDB {{ si
+{{site.data.alerts.callout_info}} +{% include_cached feature-phases/preview.md %} +{{site.data.alerts.end}} + To enable metrics export for your CockroachDB {{ site.data.products.dedicated }} cluster to Datadog, you can either enable the Datadog integration in your CockroachDB {{ site.data.products.dedicated }} Cloud Console, or on the command line via the [Cloud API]({% link cockroachcloud/cloud-api.md %}): - To enable metrics export to Datadog using the Cloud Console, follow the [Monitor CockroachDB {{ site.data.products.dedicated }} with Datadog]({% link cockroachcloud/tools-page.md %}#monitor-cockroachdb-dedicated-with-datadog) instructions. @@ -322,12 +328,21 @@ A subset of CockroachDB metrics require that you explicitly [enable percentiles]
+
+ +{{site.data.alerts.callout_info}} +Exporting Metrics to Azure Monitor from a CockroachDB {{ site.data.products.dedicated }} cluster is in **[limited access](https://www.cockroachlabs.com/docs/{{ site.current_cloud_version }}/cockroachdb-feature-availability)** and is only available to enrolled organizations. To enroll your organization, contact your Cockroach Labs account team. This feature is subject to change. +{{site.data.alerts.end}} + +
+ ## Monitor the status of a metrics export configuration
+
@@ -384,6 +399,24 @@ Where:
+
+ +To check the status of an existing Azure Monitor metrics export configuration, use the following Cloud API command: + +{% include_cached copy-clipboard.html %} +~~~shell +curl --request GET \ + --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/metricexport/azuremonitor \ + --header "Authorization: Bearer {secret_key}" +~~~ + +Where: + +- `{cluster_id}` is your CockroachDB {{ site.data.products.dedicated }} cluster's cluster ID, which can be found in the URL of your [Cloud Console](https://cockroachlabs.cloud/clusters/) for the specific cluster you wish to configure, resembling `f78b7feb-b6cf-4396-9d7f-494982d7d81e`. +- `{secret_key}` is your CockroachDB {{ site.data.products.dedicated }} API key. See [API Access]({% link cockroachcloud/managing-access.md %}) for instructions on generating this key. + +
+ ## Update an existing metrics export configuration To update an existing CockroachDB {{ site.data.products.dedicated }} metrics export configuration, make any necessary changes to your cloud provider configuration (e.g., AWS CloudWatch, Datadog, or Prometheus), then issue the same `POST` Cloud API command as shown in the [Enable metrics export](#enable-metrics-export) instructions for your cloud provider with the desired updated configuration. Follow the [Monitor the status of a metrics export configuration](#monitor-the-status-of-a-metrics-export-configuration) instructions to ensure the update completes successfully. @@ -394,6 +427,7 @@ To update an existing CockroachDB {{ site.data.products.dedicated }} metrics exp +
@@ -450,9 +484,26 @@ Where:
+
+ +To disable an existing Azure Monitor metrics export configuration, and stop sending metrics to Azure Monitor, use the following Cloud API command: + +{% include_cached copy-clipboard.html %} +~~~shell +curl --request DELETE \ + --url https://cockroachlabs.cloud/api/v1/clusters/{cluster_id}/metricexport/azuremonitor \ + --header "Authorization: Bearer {secret_key}" +~~~ + +Where: + +- `{cluster_id}` is your CockroachDB {{ site.data.products.dedicated }} cluster's cluster ID, which can be found in the URL of your [Cloud Console](https://cockroachlabs.cloud/clusters/) for the specific cluster you wish to configure, resembling `f78b7feb-b6cf-4396-9d7f-494982d7d81e`. +- `{secret_key}` is your CockroachDB {{ site.data.products.dedicated }} API key. See [API Access]({% link cockroachcloud/managing-access.md %}) for instructions on generating this key. +
+ ## Limitations -- Metrics export to AWS CloudWatch is only available on CockroachDB {{ site.data.products.dedicated }} clusters which are hosted on AWS. If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead. +- Metrics export to AWS CloudWatch is only available on CockroachDB {{ site.data.products.dedicated }} clusters that are hosted on AWS. Similarly, metrics export to Azure is only available on CockroachDB {{ site.data.products.dedicated }} clusters that are hosted on Azure. If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on GCP, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead. - AWS CloudWatch does not currently support histograms. Any histogram-type metrics emitted from your CockroachDB {{ site.data.products.dedicated }} cluster are dropped by CloudWatch. See [Prometheus metric type conversion](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-metrics-conversion.html) for more information, and [Logging dropped Prometheus metrics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContainerInsights-Prometheus-troubleshooting-EKS.html#ContainerInsights-Prometheus-troubleshooting-droppedmetrics) for instructions on tracking dropped histogram metrics in CloudWatch. ## Troubleshooting @@ -463,7 +514,7 @@ Be sure you are providing **your own** AWS Account ID as shown on the AWS [IAM p If you are using an existing AWS role, or are otherwise using a role name different from the example name used in this tutorial, be sure to use your own role name in step 8 in place of `CockroachCloudMetricsExportRole`. -Your CockroachDB {{ site.data.products.dedicated }} cluster must be running on AWS (not GCP or Azure) to make use of metrics export to AWS CloudWatch. If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on GCP or Azure, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead. +Your CockroachDB {{ site.data.products.dedicated }} cluster must be running on AWS (not GCP or Azure) to make use of metrics export to AWS CloudWatch. If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on Azure, you can export metrics to [Azure Monitor]({% link cockroachcloud/export-metrics.md %}?filters=azure-monitor-metrics-export). If your CockroachDB {{ site.data.products.dedicated }} cluster is hosted on GCP, you can export metrics to [Datadog]({% link cockroachcloud/export-metrics.md %}?filters=datadog-metrics-export) or [Prometheus]({% link cockroachcloud/export-metrics.md %}?filters=prometheus-metrics-export) instead. ## See Also diff --git a/src/current/cockroachcloud/migrations-page.md b/src/current/cockroachcloud/migrations-page.md index 2655fb9da3d..af9f7bcae63 100644 --- a/src/current/cockroachcloud/migrations-page.md +++ b/src/current/cockroachcloud/migrations-page.md @@ -1,6 +1,6 @@ --- -title: Use the Schema Conversion Tool -summary: Use the Schema Conversion Tool to begin a database migration to CockroachDB. +title: Use the MOLT Schema Conversion Tool +summary: Use the MOLT Schema Conversion Tool to begin a database migration to CockroachDB. toc: true cloud: true docs_area: migrate @@ -8,11 +8,11 @@ docs_area: migrate {% capture version_prefix %}{{site.current_cloud_version}}/{% endcapture %} -The **Migrations** page on the CockroachDB {{ site.data.products.cloud }} Console features a **Schema Conversion Tool** that helps you: +The **Migrations** page on the CockroachDB {{ site.data.products.cloud }} Console features the MOLT Schema Conversion Tool. This tool helps you: - Convert a schema from a PostgreSQL, MySQL, Oracle, or Microsoft SQL Server database for use with CockroachDB. -- [Export the converted schema.](#export-the-schema) {% include cockroachcloud/migration/sct-self-hosted.md %} - Migrate directly to a CockroachDB {{ site.data.products.cloud }} database that uses the converted schema. You specify the target database and database owner when [migrating the schema](#migrate-the-schema). +- [Export the converted schema.](#export-the-schema) {% include cockroachcloud/migration/sct-self-hosted.md %} {{site.data.alerts.callout_info}} The **Migrations** page is used to convert a schema for use with CockroachDB and to create a new database that uses the schema. It does not include moving data to the new database. For details on all steps required to complete a database migration, see the [Migration Overview]({% link {{version_prefix}}migration-overview.md %}). @@ -102,10 +102,6 @@ The dump file must be smaller than 4 MB. `INSERT` and `COPY` statements will be
### Use Credentials -{{site.data.alerts.callout_info}} -{% include feature-phases/preview.md %} -{{site.data.alerts.end}} - The Schema Conversion Tool can connect directly to a PostgreSQL or MySQL database to obtain the schema. To add a schema using credentials: 1. In step 2 of the **Add SQL Schema** dialog, click **Use Credential**. Select the credentials to use. If the list is empty, this is because no credentials have been created for the selected database type. You can [add credentials](#add-database-credentials) directly from the pulldown menu. @@ -125,7 +121,7 @@ Credentials can be added for PostgreSQL and MySQL databases. 1. Provide the following information: - A **Credential Name** to associate with the credentials. - The **Dialect** of the database you are connecting to. Currently, PostgreSQL and MySQL are supported. - - The **Host** for accessing the database. For example, `migrations.cockroachlabs.com`. Local hosts such as `localhost` and `127.0.0.1` are not allowed. + - The **Host** (i.e., hostname or IP address) for accessing the database. Exclude the protocol (e.g., `tcp://`). For example, `migrations.cockroachlabs.com`. Local hosts such as `localhost` and `127.0.0.1` are not allowed. - The **Port** for accessing the database. - A valid **Username** and **Password** for accessing the database. - The **Database Name** to access. The Schema Conversion Tool will obtain the schema for this database. diff --git a/src/current/cockroachcloud/network-authorization.md b/src/current/cockroachcloud/network-authorization.md index de0cae01fc8..606d73959b2 100644 --- a/src/current/cockroachcloud/network-authorization.md +++ b/src/current/cockroachcloud/network-authorization.md @@ -16,7 +16,11 @@ You can authorize network access to your cluster by: - [Adding an authorized range of public IP addresses](#ip-allowlisting). - Setting up private connectivity so that inbound connections to your cluster from your cloud tenant are made over the cloud provider's private network rather than over the public internet, for enhanced network security and reduced network latency. If you use IP allowlisting rules together with private connectivity, private networks do not need to be added to that allowlist. - For CockroachDB {{ site.data.products.dedicated }} clusters deployed on GCP, refer to [Google Cloud Platform (GCP) Virtual Private Cloud (VPC) peering](#vpc-peering). For CockroachDB {{ site.data.products.dedicated }} clusters or multi-region CockroachDB {{ site.data.products.serverless }} clusters deployed on AWS, refer to [Amazon Web Service (AWS) PrivateLink](#aws-privatelink). + - CockroachDB {{ site.data.products.dedicated }} clusters deployed on GCP can connect privately using GCP Private Service Connect (PSC) (Preview) or GCP VPC peering. PSC allows you to selectively connect your cluster to a VPC within your Google Cloud project, while VPC Peering allows you to peer your cluster's VPC managed by Cockroach Cloud's VPC with a VPC within your Google Cloud project. + - CockroachDB {{ site.data.products.dedicated }} clusters deployed on AWS, as well as multi-region CockroachDB {{ site.data.products.serverless }} clusters deployed on AWS, can connect privately using AWS PrivateLink, which allows you to connect your cluster's VPC managed by CockroachDB {{ site.data.products.cloud }} with a VPC within your AWS account. + + For detailed instructions, refer to [Establish private connectivity]({% link cockroachcloud/connect-to-your-cluster.md %}#establish-private-connectivity). + {{site.data.alerts.callout_info}} {% include cockroachcloud/cdc/kafka-vpc-limitation.md %} @@ -24,11 +28,11 @@ You can authorize network access to your cluster by: **Prerequisite**: {% include cockroachcloud/cluster-operator-prereq.md %} -Use GCP VPC Peering or AWS PrivateLink if: +Use private connectivity if: - You need to allowlist more defined IP address ranges than the [default maximum](#ip-allowlisting). - Your servers’ IP addresses are not static. -- You want to avoid exposing your cluster to the public internet. +- You have a requirement to avoid exposing your cluster to the public internet. Learn more about [Private Clusters (Preview)]({% link cockroachcloud/private-clusters.md %}), which offer enhanced cluster security. A private cluster's nodes have no public IP addresses. @@ -72,29 +76,6 @@ Refer to: - [Connect to a CockroachDB {{ site.data.products.serverless }} Cluster: Authorize your network]({% link cockroachcloud/connect-to-a-serverless-cluster.md %}#authorize-your-network). - [Connect to a CockroachDB {{ site.data.products.dedicated }} Cluster: Authorize your network]({% link cockroachcloud/connect-to-your-cluster.md %}#authorize-your-network). -## VPC peering - -If you select GCP as your cloud provider while [creating your CockroachDB {{ site.data.products.dedicated }} cluster]({% link cockroachcloud/create-your-cluster.md %}), you can use [Google Cloud's VPC Network Peering](https://cloud.google.com/vpc/docs/vpc-peering) feature to connect your GCP application directly to your CockroachDB {{ site.data.products.dedicated }} cluster using internal IP addresses, thus limiting exposure to the public network and reducing network latency. - -GKE users should note that we recommend deploying your application to a VPC-native cluster that uses [alias IP addresses](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips). If you are connecting from a [routes-based GKE cluster](https://cloud.google.com/kubernetes-engine/docs/how-to/routes-based-cluster) instead, you will have to [export custom routes](https://cloud.google.com/vpc/docs/vpc-peering#importing-exporting-routes). CockroachDB {{ site.data.products.cloud }} will import your custom routes by default. - -Setting up a VPC peering connection between your CockroachDB {{ site.data.products.dedicated }} cluster and GCP application is a two-part process: - -1. [Configure the IP range and size while creating the CockroachDB {{ site.data.products.dedicated }} cluster]({% link cockroachcloud/create-your-cluster.md %}#step-4-enable-vpc-peering-optional) -1. [Establish a VPC Peering connection after creating the cluster]({% link cockroachcloud/connect-to-your-cluster.md %}#establish-gcp-vpc-peering-or-aws-privatelink) - -{{site.data.alerts.callout_info}} -Self-service VPC peering setup is not supported for CockroachDB {{ site.data.products.dedicated }} clusters deployed before March 5, 2020. If your cluster was deployed before March 5, 2020, you will have to [create a new cluster]({% link cockroachcloud/create-your-cluster.md %}) with VPC peering enabled, then [export your data]({% link cockroachcloud/use-managed-service-backups.md %}) from the old cluster to the new cluster. If your cluster was deployed on or after March 5, 2020, it will be locked into CockroachDB {{ site.data.products.dedicated }}'s default IP range (`172.28.0.0/14`) unless you explicitly configured a different IP range during cluster creation. -{{site.data.alerts.end}} - -## AWS PrivateLink - -If your cloud provider is AWS, you can use [AWS PrivateLink](https://aws.amazon.com/privatelink/) to securely connect your AWS application with your CockroachDB {{ site.data.products.dedicated }} or multi-region CockroachDB {{ site.data.products.serverless }} clusters using private endpoints. Like VPC Peering, a PrivateLink connection will prevent your traffic from being exposed to the public internet and reduce network latency. - -Refer to: -- [Managing AWS PrivateLink for a CockroachDB {{ site.data.products.dedicated }} Cluster]({% link cockroachcloud/aws-privatelink.md %}) -- [Managing AWS PrivateLink for a multi-region CockroachDB {{ site.data.products.serverless }} Cluster]({% link cockroachcloud/aws-privatelink.md %}?filters=serverless) - ## DB Console The DB Console provides details about your cluster and database configuration, and helps you optimize cluster performance. diff --git a/src/current/cockroachcloud/pci-dss.md b/src/current/cockroachcloud/pci-dss.md index 196eff726fe..831914b6350 100644 --- a/src/current/cockroachcloud/pci-dss.md +++ b/src/current/cockroachcloud/pci-dss.md @@ -86,7 +86,7 @@ When a system complies with PCI DSS, the system meets the goals of the standard -CockroachDB {{ site.data.products.dedicated }} advanced is certified by a PCI QSA to be compliant with [PCI DSS 3.2.1](https://listings.pcisecuritystandards.org/documents/SAQ_D_v3_Merchant.pdf) within the DBaaS platform. Customers are still responsible to ensure that their applications are PCI DSS compliant. Customers may need to take the additional outlines outlined in [Responsibilities of the customer](#responsibilities-of-the-customer) to maintain their own PCI compliance when using CockroachDB {{ site.data.products.dedicated }} clusters for cardholder data or other sensitive data. +CockroachDB {{ site.data.products.dedicated }} advanced is certified by a PCI QSA to be compliant with [PCI DSS 3.2.1](https://listings.pcisecuritystandards.org/documents/SAQ_D_v3_Merchant.pdf) within the DBaaS platform. Customers are still responsible to ensure that their applications are PCI DSS compliant. Customers may need to take the additional actions outlined in [Responsibilities of the customer](#responsibilities-of-the-customer) to maintain their own PCI compliance when using CockroachDB {{ site.data.products.dedicated }} clusters for cardholder data or other sensitive data. ## Responsibilities of Cockroach Labs diff --git a/src/current/cockroachcloud/regions.md b/src/current/cockroachcloud/regions.md index 42f7ae0f47e..5baff13815b 100644 --- a/src/current/cockroachcloud/regions.md +++ b/src/current/cockroachcloud/regions.md @@ -22,11 +22,15 @@ For optimal performance, configure your cluster's regions to be as near as possi {{site.data.alerts.callout_info}} Creating a CockroachDB {{ site.data.products.serverless }} cluster on Azure is not supported. {{site.data.alerts.end}} +
## AWS regions +
+ CockroachDB {{ site.data.products.serverless }} clusters can be deployed in the following [AWS regions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html): + Geographic Area | Region Name | Location ----------------|------------------|--------- Asia Pacific | `ap-south-1` | Mumbai @@ -35,26 +39,10 @@ North America | `us-east-1` | N. Virginia | `us-west-2` | Oregon Western Europe | `eu-central-1` | Frankfurt | `eu-west-1` | Ireland - -## GCP regions - -CockroachDB {{ site.data.products.serverless }} clusters can be deployed in the following [GCP regions](https://cloud.google.com/compute/docs/regions-zones): - -Geographic Area | Region Name | Location -----------------|---------------------------|--------- -Asia Pacific | `asia-southeast1` | Jurong West -North America | `us-central1` | Iowa - | `us-east1` | South Carolina - | `us-west2` | California -South America | `southamerica-east1` | São Paulo -Western Europe | `europe-west1` | St. Ghislain -
-## AWS regions - CockroachDB {{ site.data.products.dedicated }} clusters can be deployed in the following [AWS regions](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.RegionsAndAvailabilityZones.html): Geographic Area | Region Name | Location @@ -65,6 +53,7 @@ Asia Pacific | `ap-northeast-1` | Tokyo | `ap-south-1` | Mumbai | `ap-southeast-1` | Singapore | `ap-southeast-2` | Sydney +Middle East | `me-central-1` | United Arab Emirates North America | `ca-central-1` | Central Canada | `us-east-1` | N. Virginia | `us-east-2` | Ohio @@ -76,39 +65,26 @@ Western Europe | `eu-central-1` | Frankfurt | `eu-west-2` | London | `eu-west-3` | Paris -## Azure regions +
-CockroachDB {{ site.data.products.cloud }} clusters can be deployed in the following [Azure regions](https://learn.microsoft.com/azure/reliability/availability-zones-overview#regions): +## GCP regions -Geographic Area | Region Name | Location -----------------|----------------------|--------- -Africa | `southafricanorth` | Johannesburg -Asia Pacific | `australiaeast` | New South Wales - | `japaneast` | Tokyo - | `koreacentral` | Seoul - | `centralindia` | Pune - | `eastasia` | Hong Kong - | `southeastasia` | Singapore -Middle East | `qatarcentral` | Doha - | `uaenorth` | Dubai -North America | `canadacentral` | Toronto - | `centralus` | Iowa - | `eastus` | Virginia - | `eastus2` | Virginia - | `southcentralus` | Texas - | `westus2` | Washington - | `westus3` | Washington -Western Europe | `francecentral` | Paris - | `germanywestcentral` | Frankfurt - | `northeurope` | Ireland - | `norwayeast` | Oslo - | `polandcentral` | Warsaw - | `swedencentral` | Gävle - | `switzerlandnorth` | Zürich - | `uksouth` | London - | `westeurope` | Netherlands +
-## GCP regions +CockroachDB {{ site.data.products.serverless }} clusters can be deployed in the following [GCP regions](https://cloud.google.com/compute/docs/regions-zones): + +Geographic Area | Region Name | Location +----------------|---------------------------|--------- +Asia Pacific | `asia-southeast1` | Jurong West +North America | `us-central1` | Iowa + | `us-east1` | South Carolina + | `us-west2` | California +South America | `southamerica-east1` | São Paulo +Western Europe | `europe-west1` | St. Ghislain + +
+ +
CockroachDB {{ site.data.products.dedicated }} clusters can be deployed in the following [GCP regions](https://cloud.google.com/compute/docs/regions-zones): @@ -125,11 +101,15 @@ Asia Pacific | `asia-east1` | Changhua County | `asia-southeast2` | Jakarta | `australia-southeast1` | Sydney | `australia-southeast2` | Melbourne +Middle East | `me-central1` | Doha + | `me-west1` | Tel Aviv North America | `northamerica-northeast1` | Montréal | `northamerica-northeast2` | Toronto | `us-central1` | Iowa | `us-east1` | South Carolina | `us-east4` | Virginia + | `us-east5` | Columbus + | `us-south1` | Dallas | `us-west1` | Oregon | `us-west2` | California | `us-west3` | Salt Lake City @@ -137,10 +117,49 @@ North America | `northamerica-northeast1` | Montréal South America | `southamerica-east1` | São Paulo Western Europe | `europe-central2` | Warsaw | `europe-north1` | Hamina + | `europe-southwest1` | Madrid | `europe-west1` | St. Ghislain | `europe-west2` | London | `europe-west3` | Frankfurt | `europe-west4` | Eemshaven | `europe-west6` | Zürich + | `europe-west9` | Paris + | `europe-west12` | Turin + +
+ +
+ +## Azure regions + +CockroachDB {{ site.data.products.dedicated }} clusters can be deployed in the following [Azure regions](https://learn.microsoft.com/azure/reliability/availability-zones-overview#regions): + +Geographic Area | Region Name | Location +----------------|----------------------|--------- +Africa | `southafricanorth` | Johannesburg +Asia Pacific | `australiaeast` | New South Wales + | `japaneast` | Tokyo + | `koreacentral` | Seoul + | `centralindia` | Pune + | `eastasia` | Hong Kong + | `southeastasia` | Singapore +Middle East | `qatarcentral` | Doha + | `uaenorth` | Dubai +North America | `canadacentral` | Toronto + | `centralus` | Iowa + | `eastus` | Virginia + | `eastus2` | Virginia + | `southcentralus` | Texas + | `westus2` | Washington + | `westus3` | Washington +Western Europe | `francecentral` | Paris + | `germanywestcentral` | Frankfurt + | `northeurope` | Ireland + | `norwayeast` | Oslo + | `polandcentral` | Warsaw + | `swedencentral` | Gävle + | `switzerlandnorth` | Zürich + | `uksouth` | London + | `westeurope` | Netherlands
diff --git a/src/current/cockroachcloud/security-overview.md b/src/current/cockroachcloud/security-overview.md index abd67ef9f72..9c6ba2e1869 100644 --- a/src/current/cockroachcloud/security-overview.md +++ b/src/current/cockroachcloud/security-overview.md @@ -106,7 +106,7 @@ The following table summarizes the CockroachDB {{ site.data.products.cloud }} se Cloud Organization users with fine-grained access roles - Network Security + Network Security ✓ ✓ SQL-level configuration of allowed authentication attempts by IP address @@ -129,12 +129,17 @@ The following table summarizes the CockroachDB {{ site.data.products.cloud }} se   ✓ - VPC Peering for GCP clusters + Private Service Connect (PSC) (Preview) for GCP clusters   ✓ - PrivateLink for AWS clusters + VPC Peering for GCP clusters + + + ✓1 + ✓ + PrivateLink for AWS clusters. Non-Repudiation @@ -154,3 +159,5 @@ The following table summarizes the CockroachDB {{ site.data.products.cloud }} se CockroachDB, as a distributed SQL database, is uniquely resilient by nature. A cluster can tolerate node failures as long as the majority of nodes remain functional. See Disaster Recovery. + +1: AWS PrivateLink is in preview for multi-region Serverless clusters, and is not supported for single-region Serverless clusters. Refer to Manage AWS PrivateLink. diff --git a/src/current/images/v23.1/changefeed-pubsub-output.png b/src/current/images/v23.1/changefeed-pubsub-output.png deleted file mode 100644 index b18f4f712d3..00000000000 Binary files a/src/current/images/v23.1/changefeed-pubsub-output.png and /dev/null differ diff --git a/src/current/images/v23.2/changefeed-pubsub-output.png b/src/current/images/v23.2/changefeed-pubsub-output.png deleted file mode 100644 index b18f4f712d3..00000000000 Binary files a/src/current/images/v23.2/changefeed-pubsub-output.png and /dev/null differ diff --git a/src/current/images/v24.1/changefeed-pubsub-output.png b/src/current/images/v24.1/changefeed-pubsub-output.png deleted file mode 100644 index b18f4f712d3..00000000000 Binary files a/src/current/images/v24.1/changefeed-pubsub-output.png and /dev/null differ diff --git a/src/current/images/v24.1/ui-jobs-page.png b/src/current/images/v24.1/ui-jobs-page.png new file mode 100644 index 00000000000..9da4f09d278 Binary files /dev/null and b/src/current/images/v24.1/ui-jobs-page.png differ diff --git a/src/current/images/v24.1/ui-replication-lag.png b/src/current/images/v24.1/ui-replication-lag.png new file mode 100644 index 00000000000..b0b1c1692aa Binary files /dev/null and b/src/current/images/v24.1/ui-replication-lag.png differ diff --git a/src/current/releases/index.md b/src/current/releases/index.md index 19655d9ffea..6dd8b41ec3b 100644 --- a/src/current/releases/index.md +++ b/src/current/releases/index.md @@ -109,7 +109,7 @@ As of 2024, CockroachDB is released under a staged delivery process. New release {% for r in releases %} - {% capture lts_link_linux %}{% if r.lts == true %} ([LTS]({% link releases/release-support-policy.md %}#support-types)){% endif %}{% endcapture %} + {% capture lts_link_linux %}{% if r.lts == true %} ([LTS]({% link releases/release-support-policy.md %})){% endif %}{% endcapture %} {% comment %} Add "Latest" class to release if it's the latest release. {% endcomment %} @@ -272,7 +272,7 @@ macOS downloads are **experimental**. Experimental downloads are not yet qualifi {% for r in releases %} - {% capture lts_link_docker %}{% if r.lts == true %} ([LTS]({% link releases/release-support-policy.md %}#support-types)){% endif %}{% endcapture %} + {% capture lts_link_docker %}{% if r.lts == true %} ([LTS]({% link releases/release-support-policy.md %})){% endif %}{% endcapture %} {% comment %} Add "Latest" class to release if it's the latest release. {% endcomment %} diff --git a/src/current/v23.1/changefeed-examples.md b/src/current/v23.1/changefeed-examples.md index 8bcf3f89f7e..aa0e00e728a 100644 --- a/src/current/v23.1/changefeed-examples.md +++ b/src/current/v23.1/changefeed-examples.md @@ -451,35 +451,42 @@ You'll need access to a [Google Cloud Project](https://cloud.google.com/resource NOTICE: changefeed will emit to topic movr-users ~~~ - To view all the messages delivered to your topic, you can use the Cloud Console. You'll see the messages emitted to the `movr-users-sub` subscription. - - Google Cloud Console changefeed message output from movr database - - To view published messages from your terminal, run the following command: - - {% include_cached copy-clipboard.html %} - ~~~ shell - gcloud pubsub subscriptions pull movr-users-sub --auto-ack --limit=10 - ~~~ - - This command will **only** pull these messages once per subscription. For example, if you ran this command again you would receive 10 different messages in your output. To receive more than one message at a time, pass the `--limit` flag. For more details, see the [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull) documentation. - - ~~~ - ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ - │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ - ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────────────────────────────────────────────┼────────────┼──────────────────┤ - │ {"key":["boston","40ef7cfa-5e16-4bd3-9e14-2f23407a66df"],"value":{"after":{"address":"14980 Gentry Plains Apt. 64","city":"boston","credit_card":"2466765790","id":"40ef7cfa-5e16-4bd3-9e14-2f23407a66df","name":"Vickie Fitzpatrick"}},"topic":"movr-users"} │ 4466153049158588 │ ["boston", "40ef7cfa-5e16-4bd3-9e14-2f23407a66df"] │ │ │ - │ {"key":["los angeles","947ae147-ae14-4800-8000-00000000001d"],"value":{"after":{"address":"35627 Chelsey Tunnel Suite 94","city":"los angeles","credit_card":"2099932769","id":"947ae147-ae14-4800-8000-00000000001d","name":"Kenneth Barnes"}},"topic":"movr-users"} │ 4466144577818136 │ ["los angeles", "947ae147-ae14-4800-8000-00000000001d"] │ │ │ - │ {"key":["amsterdam","c28f5c28-f5c2-4000-8000-000000000026"],"value":{"after":{"address":"14729 Karen Radial","city":"amsterdam","credit_card":"5844236997","id":"c28f5c28-f5c2-4000-8000-000000000026","name":"Maria Weber"}},"topic":"movr-users"} │ 4466151194002912 │ ["amsterdam", "c28f5c28-f5c2-4000-8000-000000000026"] │ │ │ - │ {"key":["new york","6c8ab772-584a-439d-b7b4-fda37767c74c"],"value":{"after":{"address":"34196 Roger Row Suite 6","city":"new york","credit_card":"3117945420","id":"6c8ab772-584a-439d-b7b4-fda37767c74c","name":"James Lang"}},"topic":"movr-users"} │ 4466147099992681 │ ["new york", "6c8ab772-584a-439d-b7b4-fda37767c74c"] │ │ │ - │ {"key":["boston","c56dab0a-63e7-4fbb-a9af-54362c481c41"],"value":{"after":{"address":"83781 Ross Overpass","city":"boston","credit_card":"7044597874","id":"c56dab0a-63e7-4fbb-a9af-54362c481c41","name":"Mark Butler"}},"topic":"movr-users"} │ 4466150752442731 │ ["boston", "c56dab0a-63e7-4fbb-a9af-54362c481c41"] │ │ │ - │ {"key":["amsterdam","f27e09d5-d7cd-4f88-8b65-abb910036f45"],"value":{"after":{"address":"77153 Donald Road Apt. 62","city":"amsterdam","credit_card":"7531160744","id":"f27e09d5-d7cd-4f88-8b65-abb910036f45","name":"Lisa Sandoval"}},"topic":"movr-users"} │ 4466147182359256 │ ["amsterdam", "f27e09d5-d7cd-4f88-8b65-abb910036f45"] │ │ │ - │ {"key":["new york","46d200c0-6924-4cc7-b3c9-3398997acb84"],"value":{"after":{"address":"92843 Carlos Grove","city":"new york","credit_card":"8822366402","id":"46d200c0-6924-4cc7-b3c9-3398997acb84","name":"Mackenzie Malone"}},"topic":"movr-users"} │ 4466142864542016 │ ["new york", "46d200c0-6924-4cc7-b3c9-3398997acb84"] │ │ │ - │ {"key":["boston","52ecbb26-0eab-4e0b-a160-90caa6a7d350"],"value":{"after":{"address":"95044 Eric Corner Suite 33","city":"boston","credit_card":"3982363300","id":"52ecbb26-0eab-4e0b-a160-90caa6a7d350","name":"Brett Porter"}},"topic":"movr-users"} │ 4466152539161631 │ ["boston", "52ecbb26-0eab-4e0b-a160-90caa6a7d350"] │ │ │ - │ {"key":["amsterdam","ae147ae1-47ae-4800-8000-000000000022"],"value":{"after":{"address":"88194 Angela Gardens Suite 94","city":"amsterdam","credit_card":"4443538758","id":"ae147ae1-47ae-4800-8000-000000000022","name":"Tyler Dalton"}},"topic":"movr-users"} │ 4466151398997150 │ ["amsterdam", "ae147ae1-47ae-4800-8000-000000000022"] │ │ │ - │ {"key":["paris","dc28f5c2-8f5c-4800-8000-00000000002b"],"value":{"after":{"address":"2058 Rodriguez Stream","city":"paris","credit_card":"9584502537","id":"dc28f5c2-8f5c-4800-8000-00000000002b","name":"Tony Ortiz"}},"topic":"movr-users"} │ 4466146372222914 │ ["paris", "dc28f5c2-8f5c-4800-8000-00000000002b"] │ │ │ - └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────────────────────────────────────────────┴────────────┴──────────────────┘ - ~~~ + To view all the messages delivered to your topic, you can use: + - The Google Cloud Console. From the Pub/Sub menu, select **Subscriptions** in the left-hand navigation and then select the subscription ID from your list of subscriptions. On the subscription's overview, click **Messages**, and then **Pull** to view messages. + - The `gcloud` CLI. From your terminal, run the following command: + + {% include_cached copy-clipboard.html %} + ~~~ shell + gcloud pubsub subscriptions pull movr-users-sub --auto-ack --limit=10 + ~~~ + + This command will **only** pull these messages once per subscription. For example, if you ran this command again you would receive 10 different messages in your output. To receive more than one message at a time, pass the `--limit` flag. For more details, refer to the [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull) documentation. + + If you have enabled the `changefeed.new_pubsub_sink_enabled` cluster setting, the output will contain capitalized top-level fields: + + ~~~ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬──────────────┬────────────┬──────────────────┬────────────┐ + │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ ACK_STATUS │ + ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼──────────────┼────────────┼──────────────────┼────────────┤ + │ {"Key":["amsterdam", "09ee2856-5856-40c4-85d3-7d65bed978f0"],"Value":{"after": {"address": "84579 Peter Divide Apt. 47", "city": "amsterdam", "credit_card": "0100007510", "id": "09ee2856-5856-40c4-85d3-7d65bed978f0", "name": "Timothy Jackson"}},"Topic":"movr-users"} │ 11249015757941393 │ │ │ │ SUCCESS │ + │ {"Key":["new york", "8803ab9e-5001-4994-a2e6-68d587f95f1d"],"Value":{"after": {"address": "37546 Andrew Roads Apt. 68", "city": "new york", "credit_card": "4731676650", "id": "8803ab9e-5001-4994-a2e6-68d587f95f1d", "name": "Susan Harrington"}},"Topic":"movr-users"} │ 11249015757941394 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "32e27201-ca0d-4a0c-ada2-fbf47f6a4711"],"Value":{"after": {"address": "86725 Stephen Gardens", "city": "seattle", "credit_card": "3639690115", "id": "32e27201-ca0d-4a0c-ada2-fbf47f6a4711", "name": "Brad Hill"}},"Topic":"movr-users"} │ 11249015757941395 │ │ │ │ SUCCESS │ + ... + ~~~ + + If you have **not** enabled `changefeed.new_pubsub_sink_enabled`, the output will contain lowercase top-level fields: + + ~~~ + ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ + │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ + ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────────────────────────────────────────────┼────────────┼──────────────────┤ + │ {"key":["boston","40ef7cfa-5e16-4bd3-9e14-2f23407a66df"],"value":{"after":{"address":"14980 Gentry Plains Apt. 64","city":"boston","credit_card":"2466765790","id":"40ef7cfa-5e16-4bd3-9e14-2f23407a66df","name":"Vickie Fitzpatrick"}},"topic":"movr-users"} │ 4466153049158588 │ ["boston", "40ef7cfa-5e16-4bd3-9e14-2f23407a66df"] │ │ │ + │ {"key":["los angeles","947ae147-ae14-4800-8000-00000000001d"],"value":{"after":{"address":"35627 Chelsey Tunnel Suite 94","city":"los angeles","credit_card":"2099932769","id":"947ae147-ae14-4800-8000-00000000001d","name":"Kenneth Barnes"}},"topic":"movr-users"} │ 4466144577818136 │ ["los angeles", "947ae147-ae14-4800-8000-00000000001d"] │ │ │ + │ {"key":["amsterdam","c28f5c28-f5c2-4000-8000-000000000026"],"value":{"after":{"address":"14729 Karen Radial","city":"amsterdam","credit_card":"5844236997","id":"c28f5c28-f5c2-4000-8000-000000000026","name":"Maria Weber"}},"topic":"movr-users"} │ 4466151194002912 │ ["amsterdam", "c28f5c28-f5c2-4000-8000-000000000026"] │ │ │ + ... + ~~~ + + For more detail on the `changefeed.new_pubsub_sink_enabled` cluster setting, refer to [Pub/Sub sink messages]({% link {{ page.version.version }}/changefeed-sinks.md %}#pub-sub-sink-messages). ## Create a changefeed connected to a cloud storage sink diff --git a/src/current/v23.1/changefeed-sinks.md b/src/current/v23.1/changefeed-sinks.md index a7fc405b4c6..5f3e17f5ed1 100644 --- a/src/current/v23.1/changefeed-sinks.md +++ b/src/current/v23.1/changefeed-sinks.md @@ -198,10 +198,17 @@ See the [Changefeed Examples]({% link {{ page.version.version }}/changefeed-exam {% include feature-phases/preview.md %} {{site.data.alerts.end}} -{% include {{ page.version.version }}/cdc/pubsub-performance-setting.md %} - Changefeeds can deliver messages to a Google Cloud Pub/Sub sink, which is integrated with Google Cloud Platform. +{% include_cached new-in.html version="v23.1" %} Enable the `changefeed.new_pubsub_sink_enabled` [cluster setting]({% link {{ page.version.version }}/cluster-settings.md %}) to improve the throughput of changefeeds emitting to Pub/Sub sinks. Enabling this setting also alters the message format to use capitalized top-level fields in changefeeds emitting JSON-encoded messages. Therefore, you may need to reconfigure downstream systems to parse the new message format before enabling this setting: + +{% include_cached copy-clipboard.html %} +~~~ sql +SET CLUSTER SETTING changefeed.new_pubsub_sink_enabled = true; +~~~ + +For more details, refer to the [Pub/Sub sink messages](#pub-sub-sink-messages) section. + A Pub/Sub sink URI follows this example: ~~~ @@ -276,7 +283,29 @@ pubsub_sink_config = '{ "Flush": {"Messages": 100, "Frequency": "5s"}, "Retry": ### Pub/Sub sink messages -The following shows the default JSON messages for a changefeed emitting to Pub/Sub. These changefeed messages were emitted as part of the [Create a changefeed connected to a Google Cloud Pub/Sub sink]({% link {{ page.version.version }}/changefeed-examples.md %}#create-a-changefeed-connected-to-a-google-cloud-pub-sub-sink) example: +{{site.data.alerts.callout_info}} +In CockroachDB v23.2 and later, changefeeds will have `changefeed.new_pubsub_sink_enabled` enabled by default. +{{site.data.alerts.end}} + +When the `changefeed.new_pubsub_sink_enabled` cluster setting is enabled, changefeeds will have improved throughput and the changefeed JSON-encoded message format has top-level fields that are capitalized: + +~~~ +{Key: ..., Value: ..., Topic: ...} +~~~ + +{{site.data.alerts.callout_danger}} +Before enabling `changefeed.new_pubsub_sink_enabled`, you may need to reconfigure downstream systems to parse the new message format. +{{site.data.alerts.end}} + +With `changefeed.new_pubsub_sink_enabled` set to `false`, changefeeds emit JSON messages with the top-level fields all lowercase: + +~~~ +{key: ..., value: ..., topic: ...} +~~~ + +If `changefeed.new_pubsub_sink_enabled` is set to `false`, changefeeds will not benefit from the improved throughput performance that this setting enables. + +The following shows the default JSON messages for a changefeed created with `changefeed.new_pubsub_sink_enabled` set to `false`. These changefeed messages were emitted as part of the [Create a changefeed connected to a Google Cloud Pub/Sub sink]({% link {{ page.version.version }}/changefeed-examples.md %}#create-a-changefeed-connected-to-a-google-cloud-pub-sub-sink) example: ~~~ ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ diff --git a/src/current/v23.1/live-migration-service.md b/src/current/v23.1/live-migration-service.md index 15f1ec55e75..dec3c51062d 100644 --- a/src/current/v23.1/live-migration-service.md +++ b/src/current/v23.1/live-migration-service.md @@ -9,7 +9,7 @@ docs_area: migrate {% include feature-phases/preview.md %} {{site.data.alerts.end}} -MOLT LMS (Live Migration Service) is used to perform a [live migration]({% link {{ page.version.version }}/migration-overview.md %}#minimal-downtime) to CockroachDB. +MOLT LMS (Live Migration Service) is used during a [live migration]({% link {{ page.version.version }}/migration-overview.md %}#minimal-downtime) to CockroachDB. The LMS is a self-hosted, horizontally scalable proxy that routes traffic between an application, a source database, and a target CockroachDB database. You use the LMS to control which database, as the "source of truth", is serving reads and writes to an application. You can optionally configure the LMS to [shadow production traffic](#shadowing-modes) from the source database and validate the query results on CockroachDB. When you have sufficiently tested your application and are confident with its consistency and performance on CockroachDB, you use the LMS to [perform the cutover](#perform-a-cutover) to CockroachDB. diff --git a/src/current/v23.1/migrate-from-oracle.md b/src/current/v23.1/migrate-from-oracle.md index 7606c9d9521..0709925396c 100644 --- a/src/current/v23.1/migrate-from-oracle.md +++ b/src/current/v23.1/migrate-from-oracle.md @@ -6,10 +6,10 @@ docs_area: migrate --- {{site.data.alerts.callout_danger}} -The instructions on this page require updates. We currently recommend [using AWS Database Migration Service (DMS) to migrate data]({% link {{ page.version.version }}/aws-dms.md %}) from Oracle to CockroachDB. You can also [migrate from CSV]({% link {{ page.version.version }}/migrate-from-csv.md %}). -{{site.data.alerts.end}} +The instructions on this page are outdated. Use the [Schema Conversion Tool]({% link cockroachcloud/migrations-page.md %}?filters=oracle) to convert an Oracle schema into a compatible CockroachDB schema, and a tool such as [AWS Database Migration Service (DMS)]({% link {{ page.version.version }}/aws-dms.md %}) or [Qlik]({% link {{ page.version.version }}/qlik.md %}) to migrate data from Oracle to CockroachDB. -This page has instructions for migrating data from Oracle into CockroachDB by [importing]({% link {{ page.version.version }}/import.md %}) CSV files. Note that `IMPORT` only works for creating new tables. For information on how to add CSV data to existing tables, see [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}). +`IMPORT` is deprecated. To move data into CockroachDB, use [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}). +{{site.data.alerts.end}} To illustrate this process, we use the following sample data and tools: diff --git a/src/current/v23.1/molt-verify.md b/src/current/v23.1/molt-verify.md index 405c304308b..7bf7b9ab489 100644 --- a/src/current/v23.1/molt-verify.md +++ b/src/current/v23.1/molt-verify.md @@ -40,7 +40,7 @@ To install MOLT Verify, download the binary that matches your system. To downloa | Mac | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-arm64.tgz) | {{site.data.alerts.callout_success}} -For previous binaries, see the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). For releases v0.0.6 and earlier, see the [MOLT repository](https://github.com/cockroachdb/molt/releases). +For previous binaries, refer to the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). {{site.data.alerts.end}} To set up MOLT Verify: diff --git a/src/current/v23.1/restore.md b/src/current/v23.1/restore.md index 56127599cc5..8690ae760c0 100644 --- a/src/current/v23.1/restore.md +++ b/src/current/v23.1/restore.md @@ -117,20 +117,21 @@ You can control `RESTORE` behavior using any of the following in the `restore_op Option |
Value
| Description -------------------------------------------------------------------+---------------+------------------------------------------------------- +`debug_pause_on` | `"error" ` | Use to have a `RESTORE` [job]({% link {{ page.version.version }}/show-jobs.md %}) self pause when it encounters an error. The `RESTORE` job can then be [resumed]({% link {{ page.version.version }}/resume-job.md %}) after the error has been fixed or [canceled]({% link {{ page.version.version }}/cancel-job.md %}) to rollback the job.

Example: `WITH debug_pause_on='error'` +`DETACHED` | N/A | When `RESTORE` runs with `DETACHED`, the job will execute asynchronously. The job ID is returned after the restore job creation completes. Note that with `DETACHED` specified, further job information and the job completion status will not be returned. For more on the differences between the returned job data, see the [example]({% link {{ page.version.version }}/restore.md %}#restore-a-backup-asynchronously) below. To check on the job status, use the [`SHOW JOBS`]({% link {{ page.version.version }}/show-jobs.md %}) statement.

To run a restore within a [transaction]({% link {{ page.version.version }}/transactions.md %}), use the `DETACHED` option. +`encryption_passphrase` | Passphrase used to create the [encrypted backup]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) | The passphrase used to decrypt the file(s) that were encrypted by the [`BACKUP`]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) statement. +New in v23.1.12:`EXECUTION LOCALITY` | Key-value pairs | Restricts the execution of the restore to nodes that match the defined [locality filter]({% link {{ page.version.version }}/take-locality-restricted-backups.md %}) requirements.

Example: `WITH EXECUTION LOCALITY = 'region=us-west-1a,cloud=aws'` +`incremental_location` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | Restore an incremental backup from the alternate collection URI the backup was originally taken with.

Refer to [Restore incremental backups](#restore-the-most-recent-full-or-incremental-backup) for more detail. `into_db` | Database name | Use to [change the target database](#restore-tables-into-a-different-database) for table restores. The target database must exist before a restore with `into_db`. (Does not apply to database or cluster restores.)

Example: `WITH into_db = 'newdb'` +`kms` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | The URI of the cryptographic key stored in a key management service (KMS), or a comma-separated list of key URIs, used to [take and restore encrypted backups]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#examples). Refer to [URI Formats]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#uri-formats) on the Encrypted Backups page. The key or keys are used to encrypt the manifest and data files that the `BACKUP` statement generates, decrypt them during a [restore]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#examples) operation, and list the contents of the backup when using [`SHOW BACKUP`]({% link {{ page.version.version }}/show-backup.md %}).

AWS KMS, Google Cloud KMS, and Azure Key Vault are supported. `new_db_name` | Database name | [Rename a database during a restore](#rename-a-database-on-restore). The existing backed-up database can remain active while the same database is restored with a different name.

Example: `RESTORE DATABASE movr ... WITH new_db_name = 'new_movr'` +`schema_only` | N/A | Verify that a backup is valid by running `RESTORE ... schema_only`, which will restore the backed-up schema without any user data. Refer to [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-a-backup-is-restorable) for detail and an example. +`skip_localities_check` | N/A | Use to skip checking localities of a cluster before a restore when there are mismatched [cluster regions]({% link {{ page.version.version }}/multiregion-overview.md %}#cluster-regions) between the backup's cluster and the target cluster.

Example: `WITH skip_localities_check` `skip_missing_foreign_keys` | N/A | Use to remove the missing [foreign key]({% link {{ page.version.version }}/foreign-key.md %}) constraints before restoring.

Example: `WITH skip_missing_foreign_keys` `skip_missing_sequences` | N/A | Use to ignore [sequence]({% link {{ page.version.version }}/show-sequences.md %}) dependencies (i.e., the `DEFAULT` expression that uses the sequence).

Example: `WITH skip_missing_sequences` `skip_missing_sequence_owners` | N/A | Must be used when restoring either a table that was previously a [sequence owner]({% link {{ page.version.version }}/create-sequence.md %}#owned-by) or a sequence that was previously owned by a table.

Example: `WITH skip_missing_sequence_owners` -`skip_missing_views` | N/A | Use to skip restoring [views]({% link {{ page.version.version }}/views.md %}) that cannot be restored because their dependencies are not being restored at the same time.

Example: `WITH skip_missing_views` -`skip_localities_check` | N/A | Use to skip checking localities of a cluster before a restore when there are mismatched [cluster regions]({% link {{ page.version.version }}/multiregion-overview.md %}#cluster-regions) between the backup's cluster and the target cluster.

Example: `WITH skip_localities_check` New in v23.1:`skip_missing_udfs` | N/A | Must be used when restoring a table with referenced [UDF]({% link {{ page.version.version }}/user-defined-functions.md %}) dependencies. Any column's `DEFAULT` expression using UDFs is dropped.

Example: `WITH skip_missing_udfs` -`encryption_passphrase` | Passphrase used to create the [encrypted backup]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) | The passphrase used to decrypt the file(s) that were encrypted by the [`BACKUP`]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) statement. -`DETACHED` | N/A | When `RESTORE` runs with `DETACHED`, the job will execute asynchronously. The job ID is returned after the restore job creation completes. Note that with `DETACHED` specified, further job information and the job completion status will not be returned. For more on the differences between the returned job data, see the [example]({% link {{ page.version.version }}/restore.md %}#restore-a-backup-asynchronously) below. To check on the job status, use the [`SHOW JOBS`]({% link {{ page.version.version }}/show-jobs.md %}) statement.

To run a restore within a [transaction]({% link {{ page.version.version }}/transactions.md %}), use the `DETACHED` option. -New in v23.1.12:`EXECUTION LOCALITY` | Key-value pairs | Restricts the execution of the restore to nodes that match the defined [locality filter]({% link {{ page.version.version }}/take-locality-restricted-backups.md %}) requirements.

Example: `WITH EXECUTION LOCALITY = 'region=us-west-1a,cloud=aws'` -`debug_pause_on` | `"error" ` | Use to have a `RESTORE` [job]({% link {{ page.version.version }}/show-jobs.md %}) self pause when it encounters an error. The `RESTORE` job can then be [resumed]({% link {{ page.version.version }}/resume-job.md %}) after the error has been fixed or [canceled]({% link {{ page.version.version }}/cancel-job.md %}) to rollback the job.

Example: `WITH debug_pause_on='error'` -`incremental_location` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | Restore an incremental backup from the alternate collection URI the backup was originally taken with.

Refer to [Restore incremental backups](#restore-the-most-recent-full-or-incremental-backup) for more detail. -`schema_only` | N/A | Verify that a backup is valid by running `RESTORE ... schema_only`, which will restore the backed-up schema without any user data. Refer to [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-a-backup-is-restorable) for detail and an example. +`skip_missing_views` | N/A | Use to skip restoring [views]({% link {{ page.version.version }}/views.md %}) that cannot be restored because their dependencies are not being restored at the same time.

Example: `WITH skip_missing_views` `verify_backup_table_data` | N/A | Run a `schema_only` restore **and** have the restore read all user data from external storage, verify checksums, and discard the user data before writing it to disk. You must also include the `schema_only` option in the `RESTORE` statement with `verify_backup_table_data`. For more detail, see [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-backup-table-data-is-restorable). ### Backup file URLs diff --git a/src/current/v23.1/security-reference/security-overview.md b/src/current/v23.1/security-reference/security-overview.md index 202f7a6a5e4..98fb7e3ad06 100644 --- a/src/current/v23.1/security-reference/security-overview.md +++ b/src/current/v23.1/security-reference/security-overview.md @@ -165,11 +165,11 @@ CockroachDB {{ site.data.products.core }} here refers to the situation of a user Network-level Configuration of allowed IP addresses -   + ✓1 ✓ ✓ ✓ - VPC Peering for GCP clusters and AWS PrivateLink for AWS clusters + Private Service Connect (PSC) (Preview) or VPC Peering for GCP clusters and AWS PrivateLink for AWS clusters Non-Repudiation @@ -188,3 +188,5 @@ CockroachDB {{ site.data.products.core }} here refers to the situation of a user CockroachDB, as a distributed SQL database, is uniquely resilient by nature. A cluster can tolerate node failures as long as the majority of nodes remain functional. See Disaster Recovery. + +1: AWS PrivateLink is in preview for multi-region Serverless clusters, and is not supported for single-region Serverless clusters. Refer to Manage AWS PrivateLink. diff --git a/src/current/v23.2/changefeed-examples.md b/src/current/v23.2/changefeed-examples.md index 5030499f4e0..2c1717bcd6e 100644 --- a/src/current/v23.2/changefeed-examples.md +++ b/src/current/v23.2/changefeed-examples.md @@ -462,35 +462,32 @@ You'll need access to a [Google Cloud Project](https://cloud.google.com/resource NOTICE: changefeed will emit to topic movr-users ~~~ - To view all the messages delivered to your topic, you can use the Cloud Console. You'll see the messages emitted to the `movr-users-sub` subscription. + To view all the messages delivered to your topic, you can use: + - The Google Cloud Console. From the Pub/Sub menu, select **Subscriptions** in the left-hand navigation and then select the subscription ID from your list of subscriptions. On the subscription's overview, click **Messages**, and then **Pull** to view messages. + - The `gcloud` CLI. From your terminal, run the following command: - Google Cloud Console changefeed message output from movr database - - To view published messages from your terminal, run the following command: - - {% include_cached copy-clipboard.html %} - ~~~ shell - gcloud pubsub subscriptions pull movr-users-sub --auto-ack --limit=10 - ~~~ + {% include_cached copy-clipboard.html %} + ~~~ shell + gcloud pubsub subscriptions pull movr-users-sub --auto-ack --limit=10 + ~~~ - This command will **only** pull these messages once per subscription. For example, if you ran this command again you would receive 10 different messages in your output. To receive more than one message at a time, pass the `--limit` flag. For more details, see the [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull) documentation. + This command will **only** pull these messages once per subscription. For example, if you ran this command again you would receive 10 different messages in your output. To receive more than one message at a time, pass the `--limit` flag. For more details, refer to the [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull) documentation. - ~~~ - ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ - │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ - ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────────────────────────────────────────────┼────────────┼──────────────────┤ - │ {"key":["boston","40ef7cfa-5e16-4bd3-9e14-2f23407a66df"],"value":{"after":{"address":"14980 Gentry Plains Apt. 64","city":"boston","credit_card":"2466765790","id":"40ef7cfa-5e16-4bd3-9e14-2f23407a66df","name":"Vickie Fitzpatrick"}},"topic":"movr-users"} │ 4466153049158588 │ ["boston", "40ef7cfa-5e16-4bd3-9e14-2f23407a66df"] │ │ │ - │ {"key":["los angeles","947ae147-ae14-4800-8000-00000000001d"],"value":{"after":{"address":"35627 Chelsey Tunnel Suite 94","city":"los angeles","credit_card":"2099932769","id":"947ae147-ae14-4800-8000-00000000001d","name":"Kenneth Barnes"}},"topic":"movr-users"} │ 4466144577818136 │ ["los angeles", "947ae147-ae14-4800-8000-00000000001d"] │ │ │ - │ {"key":["amsterdam","c28f5c28-f5c2-4000-8000-000000000026"],"value":{"after":{"address":"14729 Karen Radial","city":"amsterdam","credit_card":"5844236997","id":"c28f5c28-f5c2-4000-8000-000000000026","name":"Maria Weber"}},"topic":"movr-users"} │ 4466151194002912 │ ["amsterdam", "c28f5c28-f5c2-4000-8000-000000000026"] │ │ │ - │ {"key":["new york","6c8ab772-584a-439d-b7b4-fda37767c74c"],"value":{"after":{"address":"34196 Roger Row Suite 6","city":"new york","credit_card":"3117945420","id":"6c8ab772-584a-439d-b7b4-fda37767c74c","name":"James Lang"}},"topic":"movr-users"} │ 4466147099992681 │ ["new york", "6c8ab772-584a-439d-b7b4-fda37767c74c"] │ │ │ - │ {"key":["boston","c56dab0a-63e7-4fbb-a9af-54362c481c41"],"value":{"after":{"address":"83781 Ross Overpass","city":"boston","credit_card":"7044597874","id":"c56dab0a-63e7-4fbb-a9af-54362c481c41","name":"Mark Butler"}},"topic":"movr-users"} │ 4466150752442731 │ ["boston", "c56dab0a-63e7-4fbb-a9af-54362c481c41"] │ │ │ - │ {"key":["amsterdam","f27e09d5-d7cd-4f88-8b65-abb910036f45"],"value":{"after":{"address":"77153 Donald Road Apt. 62","city":"amsterdam","credit_card":"7531160744","id":"f27e09d5-d7cd-4f88-8b65-abb910036f45","name":"Lisa Sandoval"}},"topic":"movr-users"} │ 4466147182359256 │ ["amsterdam", "f27e09d5-d7cd-4f88-8b65-abb910036f45"] │ │ │ - │ {"key":["new york","46d200c0-6924-4cc7-b3c9-3398997acb84"],"value":{"after":{"address":"92843 Carlos Grove","city":"new york","credit_card":"8822366402","id":"46d200c0-6924-4cc7-b3c9-3398997acb84","name":"Mackenzie Malone"}},"topic":"movr-users"} │ 4466142864542016 │ ["new york", "46d200c0-6924-4cc7-b3c9-3398997acb84"] │ │ │ - │ {"key":["boston","52ecbb26-0eab-4e0b-a160-90caa6a7d350"],"value":{"after":{"address":"95044 Eric Corner Suite 33","city":"boston","credit_card":"3982363300","id":"52ecbb26-0eab-4e0b-a160-90caa6a7d350","name":"Brett Porter"}},"topic":"movr-users"} │ 4466152539161631 │ ["boston", "52ecbb26-0eab-4e0b-a160-90caa6a7d350"] │ │ │ - │ {"key":["amsterdam","ae147ae1-47ae-4800-8000-000000000022"],"value":{"after":{"address":"88194 Angela Gardens Suite 94","city":"amsterdam","credit_card":"4443538758","id":"ae147ae1-47ae-4800-8000-000000000022","name":"Tyler Dalton"}},"topic":"movr-users"} │ 4466151398997150 │ ["amsterdam", "ae147ae1-47ae-4800-8000-000000000022"] │ │ │ - │ {"key":["paris","dc28f5c2-8f5c-4800-8000-00000000002b"],"value":{"after":{"address":"2058 Rodriguez Stream","city":"paris","credit_card":"9584502537","id":"dc28f5c2-8f5c-4800-8000-00000000002b","name":"Tony Ortiz"}},"topic":"movr-users"} │ 4466146372222914 │ ["paris", "dc28f5c2-8f5c-4800-8000-00000000002b"] │ │ │ - └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────────────────────────────────────────────┴────────────┴──────────────────┘ - ~~~ + ~~~ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬──────────────┬────────────┬──────────────────┬────────────┐ + │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ ACK_STATUS │ + ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼──────────────┼────────────┼──────────────────┼────────────┤ + │ {"Key":["amsterdam", "09ee2856-5856-40c4-85d3-7d65bed978f0"],"Value":{"after": {"address": "84579 Peter Divide Apt. 47", "city": "amsterdam", "credit_card": "0100007510", "id": "09ee2856-5856-40c4-85d3-7d65bed978f0", "name": "Timothy Jackson"}},"Topic":"movr-users"} │ 11249015757941393 │ │ │ │ SUCCESS │ + │ {"Key":["new york", "8803ab9e-5001-4994-a2e6-68d587f95f1d"],"Value":{"after": {"address": "37546 Andrew Roads Apt. 68", "city": "new york", "credit_card": "4731676650", "id": "8803ab9e-5001-4994-a2e6-68d587f95f1d", "name": "Susan Harrington"}},"Topic":"movr-users"} │ 11249015757941394 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "32e27201-ca0d-4a0c-ada2-fbf47f6a4711"],"Value":{"after": {"address": "86725 Stephen Gardens", "city": "seattle", "credit_card": "3639690115", "id": "32e27201-ca0d-4a0c-ada2-fbf47f6a4711", "name": "Brad Hill"}},"Topic":"movr-users"} │ 11249015757941395 │ │ │ │ SUCCESS │ + │ {"Key":["san francisco", "27b03637-ef9f-49a0-9b58-b16d7a9e34f4"],"Value":{"after": {"address": "85467 Tiffany Field", "city": "san francisco", "credit_card": "0016125921", "id": "27b03637-ef9f-49a0-9b58-b16d7a9e34f4", "name": "Mark Garcia"}},"Topic":"movr-users"} │ 11249015757941396 │ │ │ │ SUCCESS │ + │ {"Key":["rome", "982e1863-88d4-49cb-adee-0a35baae7e0b"],"Value":{"after": {"address": "54918 Sutton Isle Suite 74", "city": "rome", "credit_card": "6015706174", "id": "982e1863-88d4-49cb-adee-0a35baae7e0b", "name": "Kimberly Nichols"}},"Topic":"movr-users"} │ 11249015757941397 │ │ │ │ SUCCESS │ + │ {"Key":["washington dc", "7b298994-7b12-414c-90ef-353c7105f012"],"Value":{"after": {"address": "45205 Romero Ford Apt. 86", "city": "washington dc", "credit_card": "3519400314", "id": "7b298994-7b12-414c-90ef-353c7105f012", "name": "Taylor Bullock"}},"Topic":"movr-users"} │ 11249015757941398 │ │ │ │ SUCCESS │ + │ {"Key":["boston", "4f012f57-577b-4853-b5ab-0d79d0df1369"],"Value":{"after": {"address": "15765 Vang Ramp", "city": "boston", "credit_card": "6747715133", "id": "4f012f57-577b-4853-b5ab-0d79d0df1369", "name": "Ryan Garcia"}},"Topic":"movr-users"} │ 11249015757941399 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "9ba85917-5545-4674-8ab2-497fa47ac00f"],"Value":{"after": {"address": "24354 Whitney Lodge", "city": "seattle", "credit_card": "8642661685", "id": "9ba85917-5545-4674-8ab2-497fa47ac00f", "name": "Donald Walsh"}},"Topic":"movr-users"} │ 11249015757941400 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "98312fb3-230e-412d-9b22-074ec97329ff"],"Value":{"after": {"address": "72777 Carol Shoal", "city": "seattle", "credit_card": "7789799678", "id": "98312fb3-230e-412d-9b22-074ec97329ff", "name": "Christopher Davis"}},"Topic":"movr-users"} │ 11249015757941401 │ │ │ │ SUCCESS │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴──────────────┴────────────┴──────────────────┴────────────┘ + ~~~ ## Create a changefeed connected to a cloud storage sink diff --git a/src/current/v23.2/changefeed-sinks.md b/src/current/v23.2/changefeed-sinks.md index 1fa087b77ec..f8cf997c883 100644 --- a/src/current/v23.2/changefeed-sinks.md +++ b/src/current/v23.2/changefeed-sinks.md @@ -230,6 +230,10 @@ The following parameters are also needed, but are **set by default** in Cockroac Changefeeds can deliver messages to a Google Cloud Pub/Sub sink, which is integrated with Google Cloud Platform. +{{site.data.alerts.callout_info}} +{% include_cached new-in.html version="v23.2" %} The `changefeed.new_pubsub_sink_enabled` cluster setting is enabled by default, which provides improved throughput. Without this cluster setting enabled, changefeeds emit JSON-encoded events with the top-level message fields all lowercase. With `changefeed.new_pubsub_sink_enabled`, the top-level fields are capitalized. For more details, refer to the [Pub/Sub sink messages](#pub-sub-sink-messages) section. +{{site.data.alerts.end}} + A Pub/Sub sink URI follows this example: ~~~ @@ -304,23 +308,40 @@ pubsub_sink_config = '{ "Flush": {"Messages": 100, "Frequency": "5s"}, "Retry": ### Pub/Sub sink messages +{% include_cached new-in.html version="v23.2" %} The `changefeed.new_pubsub_sink_enabled` cluster setting is enabled by default, which provides improved changefeed throughput peformance. With `changefeed.new_pubsub_sink_enabled` enabled, the changefeed JSON-encoded message format have top-level fields that are capitalized: + +~~~ +{Key: ..., Value: ..., Topic: ...} +~~~ + +{{site.data.alerts.callout_danger}} +By default in v23.2, the capitalization of top-level fields in the message has changed. Before upgrading to CockroachDB v23.2 and later, you may need to reconfigure downstream systems to parse the new message format. +{{site.data.alerts.end}} + +With `changefeed.new_pubsub_sink_enabled` set to `false`, changefeeds emit JSON messages with the top-level fields all lowercase: + +~~~ +{key: ..., value: ..., topic: ...} +~~~ + +If `changefeed.new_pubsub_sink_enabled` is set to `false`, changefeeds will not benefit from the improved throughput performance that this setting enables. + The following shows the default JSON messages for a changefeed emitting to Pub/Sub. These changefeed messages were emitted as part of the [Create a changefeed connected to a Google Cloud Pub/Sub sink]({% link {{ page.version.version }}/changefeed-examples.md %}#create-a-changefeed-connected-to-a-google-cloud-pub-sub-sink) example: ~~~ -┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ -│ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ -├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────────────────────────────────────────────┼────────────┼──────────────────┤ -│ {"key":["boston","40ef7cfa-5e16-4bd3-9e14-2f23407a66df"],"value":{"after":{"address":"14980 Gentry Plains Apt. 64","city":"boston","credit_card":"2466765790","id":"40ef7cfa-5e16-4bd3-9e14-2f23407a66df","name":"Vickie Fitzpatrick"}},"topic":"movr-users"} │ 4466153049158588 │ ["boston", "40ef7cfa-5e16-4bd3-9e14-2f23407a66df"] │ │ │ -│ {"key":["los angeles","947ae147-ae14-4800-8000-00000000001d"],"value":{"after":{"address":"35627 Chelsey Tunnel Suite 94","city":"los angeles","credit_card":"2099932769","id":"947ae147-ae14-4800-8000-00000000001d","name":"Kenneth Barnes"}},"topic":"movr-users"} │ 4466144577818136 │ ["los angeles", "947ae147-ae14-4800-8000-00000000001d"] │ │ │ -│ {"key":["amsterdam","c28f5c28-f5c2-4000-8000-000000000026"],"value":{"after":{"address":"14729 Karen Radial","city":"amsterdam","credit_card":"5844236997","id":"c28f5c28-f5c2-4000-8000-000000000026","name":"Maria Weber"}},"topic":"movr-users"} │ 4466151194002912 │ ["amsterdam", "c28f5c28-f5c2-4000-8000-000000000026"] │ │ │ -│ {"key":["new york","6c8ab772-584a-439d-b7b4-fda37767c74c"],"value":{"after":{"address":"34196 Roger Row Suite 6","city":"new york","credit_card":"3117945420","id":"6c8ab772-584a-439d-b7b4-fda37767c74c","name":"James Lang"}},"topic":"movr-users"} │ 4466147099992681 │ ["new york", "6c8ab772-584a-439d-b7b4-fda37767c74c"] │ │ │ -│ {"key":["boston","c56dab0a-63e7-4fbb-a9af-54362c481c41"],"value":{"after":{"address":"83781 Ross Overpass","city":"boston","credit_card":"7044597874","id":"c56dab0a-63e7-4fbb-a9af-54362c481c41","name":"Mark Butler"}},"topic":"movr-users"} │ 4466150752442731 │ ["boston", "c56dab0a-63e7-4fbb-a9af-54362c481c41"] │ │ │ -│ {"key":["amsterdam","f27e09d5-d7cd-4f88-8b65-abb910036f45"],"value":{"after":{"address":"77153 Donald Road Apt. 62","city":"amsterdam","credit_card":"7531160744","id":"f27e09d5-d7cd-4f88-8b65-abb910036f45","name":"Lisa Sandoval"}},"topic":"movr-users"} │ 4466147182359256 │ ["amsterdam", "f27e09d5-d7cd-4f88-8b65-abb910036f45"] │ │ │ -│ {"key":["new york","46d200c0-6924-4cc7-b3c9-3398997acb84"],"value":{"after":{"address":"92843 Carlos Grove","city":"new york","credit_card":"8822366402","id":"46d200c0-6924-4cc7-b3c9-3398997acb84","name":"Mackenzie Malone"}},"topic":"movr-users"} │ 4466142864542016 │ ["new york", "46d200c0-6924-4cc7-b3c9-3398997acb84"] │ │ │ -│ {"key":["boston","52ecbb26-0eab-4e0b-a160-90caa6a7d350"],"value":{"after":{"address":"95044 Eric Corner Suite 33","city":"boston","credit_card":"3982363300","id":"52ecbb26-0eab-4e0b-a160-90caa6a7d350","name":"Brett Porter"}},"topic":"movr-users"} │ 4466152539161631 │ ["boston", "52ecbb26-0eab-4e0b-a160-90caa6a7d350"] │ │ │ -│ {"key":["amsterdam","ae147ae1-47ae-4800-8000-000000000022"],"value":{"after":{"address":"88194 Angela Gardens Suite 94","city":"amsterdam","credit_card":"4443538758","id":"ae147ae1-47ae-4800-8000-000000000022","name":"Tyler Dalton"}},"topic":"movr-users"} │ 4466151398997150 │ ["amsterdam", "ae147ae1-47ae-4800-8000-000000000022"] │ │ │ -│ {"key":["paris","dc28f5c2-8f5c-4800-8000-00000000002b"],"value":{"after":{"address":"2058 Rodriguez Stream","city":"paris","credit_card":"9584502537","id":"dc28f5c2-8f5c-4800-8000-00000000002b","name":"Tony Ortiz"}},"topic":"movr-users"} │ 4466146372222914 │ ["paris", "dc28f5c2-8f5c-4800-8000-00000000002b"] │ │ │ -└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────────────────────────────────────────────┴────────────┴──────────────────┘ +┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬──────────────┬────────────┬──────────────────┬────────────┐ +│ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ ACK_STATUS │ +├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼──────────────┼────────────┼──────────────────┼────────────┤ +│ {"Key":["amsterdam", "09ee2856-5856-40c4-85d3-7d65bed978f0"],"Value":{"after": {"address": "84579 Peter Divide Apt. 47", "city": "amsterdam", "credit_card": "0100007510", "id": "09ee2856-5856-40c4-85d3-7d65bed978f0", "name": "Timothy Jackson"}},"Topic":"users"} │ 11249015757941393 │ │ │ │ SUCCESS │ +│ {"Key":["new york", "8803ab9e-5001-4994-a2e6-68d587f95f1d"],"Value":{"after": {"address": "37546 Andrew Roads Apt. 68", "city": "new york", "credit_card": "4731676650", "id": "8803ab9e-5001-4994-a2e6-68d587f95f1d", "name": "Susan Harrington"}},"Topic":"users"} │ 11249015757941394 │ │ │ │ SUCCESS │ +│ {"Key":["seattle", "32e27201-ca0d-4a0c-ada2-fbf47f6a4711"],"Value":{"after": {"address": "86725 Stephen Gardens", "city": "seattle", "credit_card": "3639690115", "id": "32e27201-ca0d-4a0c-ada2-fbf47f6a4711", "name": "Brad Hill"}},"Topic":"users"} │ 11249015757941395 │ │ │ │ SUCCESS │ +│ {"Key":["san francisco", "27b03637-ef9f-49a0-9b58-b16d7a9e34f4"],"Value":{"after": {"address": "85467 Tiffany Field", "city": "san francisco", "credit_card": "0016125921", "id": "27b03637-ef9f-49a0-9b58-b16d7a9e34f4", "name": "Mark Garcia"}},"Topic":"users"} │ 11249015757941396 │ │ │ │ SUCCESS │ +│ {"Key":["rome", "982e1863-88d4-49cb-adee-0a35baae7e0b"],"Value":{"after": {"address": "54918 Sutton Isle Suite 74", "city": "rome", "credit_card": "6015706174", "id": "982e1863-88d4-49cb-adee-0a35baae7e0b", "name": "Kimberly Nichols"}},"Topic":"users"} │ 11249015757941397 │ │ │ │ SUCCESS │ +│ {"Key":["washington dc", "7b298994-7b12-414c-90ef-353c7105f012"],"Value":{"after": {"address": "45205 Romero Ford Apt. 86", "city": "washington dc", "credit_card": "3519400314", "id": "7b298994-7b12-414c-90ef-353c7105f012", "name": "Taylor Bullock"}},"Topic":"users"} │ 11249015757941398 │ │ │ │ SUCCESS │ +│ {"Key":["boston", "4f012f57-577b-4853-b5ab-0d79d0df1369"],"Value":{"after": {"address": "15765 Vang Ramp", "city": "boston", "credit_card": "6747715133", "id": "4f012f57-577b-4853-b5ab-0d79d0df1369", "name": "Ryan Garcia"}},"Topic":"users"} │ 11249015757941399 │ │ │ │ SUCCESS │ +│ {"Key":["seattle", "9ba85917-5545-4674-8ab2-497fa47ac00f"],"Value":{"after": {"address": "24354 Whitney Lodge", "city": "seattle", "credit_card": "8642661685", "id": "9ba85917-5545-4674-8ab2-497fa47ac00f", "name": "Donald Walsh"}},"Topic":"users"} │ 11249015757941400 │ │ │ │ SUCCESS │ +│ {"Key":["seattle", "98312fb3-230e-412d-9b22-074ec97329ff"],"Value":{"after": {"address": "72777 Carol Shoal", "city": "seattle", "credit_card": "7789799678", "id": "98312fb3-230e-412d-9b22-074ec97329ff", "name": "Christopher Davis"}},"Topic":"users"} │ 11249015757941401 │ │ │ │ SUCCESS │ +└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴──────────────┴────────────┴──────────────────┴────────────┘ ~~~ {% include {{ page.version.version }}/cdc/note-changefeed-message-page.md %} diff --git a/src/current/v23.2/create-changefeed.md b/src/current/v23.2/create-changefeed.md index e823f9fac61..54326575fdd 100644 --- a/src/current/v23.2/create-changefeed.md +++ b/src/current/v23.2/create-changefeed.md @@ -104,6 +104,8 @@ Example of a Google Cloud Pub/Sub sink URI: 'gcpubsub://{project name}?region={region}&topic_name={topic name}&AUTH=specified&CREDENTIALS={base64-encoded key}' ~~~ +In CockroachDB v23.2 and later, the `changefeed.new_pubsub_sink_enabled` cluster setting is enabled by default, which provides improved throughput. For details on the changes to the message format, refer to [Pub/Sub sink messages]({% link {{ page.version.version }}/changefeed-sinks.md %}#pub-sub-sink-messages). + [Use Cloud Storage for Bulk Operations]({% link {{ page.version.version }}/cloud-storage-authentication.md %}) explains the requirements for the authentication parameter with `specified` or `implicit`. Refer to [Changefeed Sinks]({% link {{ page.version.version }}/changefeed-sinks.md %}#google-cloud-pub-sub) for further consideration. #### Cloud Storage diff --git a/src/current/v23.2/live-migration-service.md b/src/current/v23.2/live-migration-service.md index e106034bd30..7f619fd3da0 100644 --- a/src/current/v23.2/live-migration-service.md +++ b/src/current/v23.2/live-migration-service.md @@ -9,7 +9,7 @@ docs_area: migrate {% include feature-phases/preview.md %} {{site.data.alerts.end}} -MOLT LMS (Live Migration Service) is used to perform a [live migration]({% link {{ page.version.version }}/migration-overview.md %}#minimal-downtime) to CockroachDB. +MOLT LMS (Live Migration Service) is used during a [live migration]({% link {{ page.version.version }}/migration-overview.md %}#minimal-downtime) to CockroachDB. The LMS is a self-hosted, horizontally scalable proxy that routes traffic between an application, a source database, and a target CockroachDB database. You use the LMS to control which database, as the "source of truth", is serving reads and writes to an application. You can optionally configure the LMS to [shadow production traffic](#shadowing-modes) from the source database and validate the query results on CockroachDB. When you have sufficiently tested your application and are confident with its consistency and performance on CockroachDB, you use the LMS to [perform the cutover](#perform-a-cutover) to CockroachDB. diff --git a/src/current/v23.2/migrate-from-oracle.md b/src/current/v23.2/migrate-from-oracle.md index 7606c9d9521..ed8e3f901d9 100644 --- a/src/current/v23.2/migrate-from-oracle.md +++ b/src/current/v23.2/migrate-from-oracle.md @@ -6,10 +6,10 @@ docs_area: migrate --- {{site.data.alerts.callout_danger}} -The instructions on this page require updates. We currently recommend [using AWS Database Migration Service (DMS) to migrate data]({% link {{ page.version.version }}/aws-dms.md %}) from Oracle to CockroachDB. You can also [migrate from CSV]({% link {{ page.version.version }}/migrate-from-csv.md %}). -{{site.data.alerts.end}} +The instructions on this page are outdated. Use the [Schema Conversion Tool]({% link cockroachcloud/migrations-page.md %}?filters=oracle) to convert an Oracle schema into a compatible CockroachDB schema, and a tool such as [AWS Database Migration Service (DMS)]({% link {{ page.version.version }}/aws-dms.md %}) or [Qlik]({% link {{ page.version.version }}/qlik.md %}) to migrate data from Oracle to CockroachDB. -This page has instructions for migrating data from Oracle into CockroachDB by [importing]({% link {{ page.version.version }}/import.md %}) CSV files. Note that `IMPORT` only works for creating new tables. For information on how to add CSV data to existing tables, see [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}). +Note that `IMPORT` is deprecated. To move data into CockroachDB, use [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}). +{{site.data.alerts.end}} To illustrate this process, we use the following sample data and tools: diff --git a/src/current/v23.2/migration-overview.md b/src/current/v23.2/migration-overview.md index 3912952a489..3e1372af46a 100644 --- a/src/current/v23.2/migration-overview.md +++ b/src/current/v23.2/migration-overview.md @@ -62,17 +62,17 @@ A lift-and-shift approach is the most straightforward. However, it's important t - *Reduced functionality* takes some, but not all, application functionality offline. For example, you can disable writes but not reads while you migrate the application data, and queue data to be written after completing the migration. -For an overview of lift-and-shift migrations to CockroachDB, see [Lift and Shift](#lift-and-shift). For considerations and details about the pros and cons of this approach, see [Migration Strategy: Lift and Shift]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}). +For an overview of lift-and-shift migrations to CockroachDB, see [Lift and Shift](#lift-and-shift). #### Minimal downtime -If your application cannot tolerate downtime, then you should aim for a "zero-downtime" approach. "Zero" means that downtime is reduced to either an absolute minimum or zero, such that users do not notice the migration. +If your application cannot tolerate downtime, then you should aim for a "zero-downtime" approach. This reduces downtime to an absolute minimum, such that users do not notice the migration. The minimum possible downtime depends on whether you can tolerate inconsistency in the migrated data: -- *Consistent* migrations reduce downtime to an absolute minimum (i.e., from 30 seconds to sub-seconds) while keeping data synchronized between the source database and CockroachDB. **Consistency requires downtime.** In this approach, downtime occurs right before [cutover](#cutover-strategy), as you drain the remaining transactions from the source database to CockroachDB. +- Migrations performed using *consistent cutover* reduce downtime to an absolute minimum (i.e., seconds or sub-seconds) while keeping data synchronized between the source database and CockroachDB. **Consistency requires downtime.** In this approach, downtime occurs right before [cutover](#cutover-strategy), as you drain the remaining transactions from the source database to CockroachDB. -- *Inconsistent* migrations can reduce downtime to zero. These require the most preparation, and typically allow read/write traffic to both databases for at least a small amount of time, thereby sacrificing consistency for availability. {% comment %}You can use the CockroachDB Live Migration Service (MOLT LMS) to run application queries simultaneously on your source database and CockroachDB.{% endcomment %} Without stopping application traffic, you perform an immediate [cutover](#cutover-strategy), while assuming that some writes will not be replicated to CockroachDB. You may want to manually reconcile these data inconsistencies after switching over. +- Migrations performed using *immediate cutover* can reduce downtime to zero. These require the most preparation, and typically allow read/write traffic to both databases for at least a short period of time, sacrificing consistency for availability. {% comment %}You can use the CockroachDB Live Migration Service (MOLT LMS) to run application queries simultaneously on your source database and CockroachDB.{% endcomment %} Without stopping application traffic, you perform an **immediate** [cutover](#cutover-strategy), while assuming that some writes will not be replicated to CockroachDB. You may want to manually reconcile these data inconsistencies after switching over. For an overview of zero-downtime migrations to CockroachDB, see [Zero Downtime](#zero-downtime). {% comment %}For details, see [Migration Strategy: Zero Downtime](migration-strategy-zero-downtime).{% endcomment %} @@ -245,9 +245,11 @@ Then import the converted schema to a CockroachDB cluster: Before moving data, Cockroach Labs recommends [dropping any indexes]({% link {{ page.version.version }}/drop-index.md %}) on the CockroachDB database. The indexes can be [recreated]({% link {{ page.version.version }}/create-index.md %}) after the data is loaded. Doing so will optimize performance. {{site.data.alerts.end}} -After [converting the schema](#convert-the-schema), load your data into CockroachDB so that you can [test your application queries](#validate-queries). Then use one of the following methods to migrate the data (you may need to use additional tooling to extract and/or convert the data to an appropriate file format): +After [converting the schema](#convert-the-schema), load your data into CockroachDB so that you can [test your application queries](#validate-queries). Then use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. -- {% include {{ page.version.version }}/migration/load-data-import-into.md %} Typically, initial data loading during a database migration will not be running concurrently with application traffic, so the fact that `IMPORT INTO` takes the table offline may not have any observable availability impact. +Alternatively, you can use one of the following methods to migrate the data. Additional tooling may be required to extract or convert the data to a supported file format. + +- {% include {{ page.version.version }}/migration/load-data-import-into.md %} Typically during a migration, data is initially loaded before foreground application traffic begins to be served, so the impact of taking the table offline when running `IMPORT INTO` may be minimal. - {% include {{ page.version.version }}/migration/load-data-third-party.md %} Within the tool, you can select the database tables to migrate to the test cluster. - {% include {{ page.version.version }}/migration/load-data-copy-from.md %} @@ -259,9 +261,9 @@ Note that CockroachDB defaults to the [`SERIALIZABLE`]({% link {{ page.version.v ##### Shadowing -You can "shadow" your production workload by executing your source SQL statements on CockroachDB in parallel. The [CockroachDB Live Migration Service (LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) can perform shadowing. You can then [test the queries](#test-query-results-and-performance) on CockroachDB for consistency, performance, and potential issues with the migration. +You can "shadow" your production workload by executing your source SQL statements on CockroachDB in parallel. You can then [validate the queries](#test-query-results-and-performance) on CockroachDB for consistency, performance, and potential issues with the migration. -Shadowing may not be necessary or practical for your workload. For example, because transactions are serialized on CockroachDB, this will limit your ability to validate the performance of high-throughput workloads. +The [CockroachDB Live Migration Service (MOLT LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) can [perform shadowing]({% link {{ page.version.version }}/live-migration-service.md %}#shadowing-modes). This is intended only for [testing](#test-query-results-and-performance) or [performing a dry run](#perform-a-dry-run). Shadowing should **not** be used in production when performing a [live migration](#zero-downtime). ##### Test query results and performance @@ -310,35 +312,32 @@ Using this method, consistency is achieved by only performing the cutover once a The following is a high-level overview of the migration steps. For considerations and details about the pros and cons of this approach, see [Migration Strategy: Lift and Shift]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}). 1. Stop application traffic to your source database. **This begins downtime.** -1. Move data in one of the following ways: - - {% include {{ page.version.version }}/migration/load-data-import-into.md %} - - {% include {{ page.version.version }}/migration/load-data-third-party.md %} - - {% include {{ page.version.version }}/migration/load-data-copy-from.md %} -1. After the data is migrated, you can use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. +1. Use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. +1. After the data is migrated, use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. 1. Perform a [cutover](#cutover-strategy) by resuming application traffic, now to CockroachDB. {% comment %}1. If you want the ability to [roll back](#all-at-once-rollback) the migration, replicate data back to the source database.{% endcomment %} ### Zero Downtime -Using this method, downtime is minimized by performing the cutover while writes are still being replicated from the source database to CockroachDB. Inconsistencies are resolved through manual reconciliation. - -The following is a high-level overview of the migration steps. {% comment %}For details on this migration strategy, see [Migration Strategy: Zero Downtime]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}).{% endcomment %} +During a "live migration", downtime is minimized by performing the cutover while writes are still being replicated from the source database to CockroachDB. Inconsistencies are resolved through manual reconciliation. -{% comment %}You can use the CockroachDB Live Migration Service (MOLT LMS) to run application queries simultaneously on your source database and CockroachDB.{% endcomment %} +The following is a high-level overview of the migration steps. The two approaches are mutually exclusive, and each has [tradeoffs](#minimal-downtime). {% comment %}For details on this migration strategy, see [Migration Strategy: Zero Downtime]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}).{% endcomment %} To prioritize consistency and minimize downtime: -1. {% include {{ page.version.version }}/migration/load-data-third-party.md %} Select the tool's option to **replicate ongoing changes** after performing the initial load of data into CockroachDB. -1. As the data is migrating, you can use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. -1. Once nearly all data from your source database has been moved to CockroachDB (for example, with a <1 second delay or <1000 rows), stop application traffic to your source database. **This begins downtime.** -1. Wait for replication to CockroachDB to complete. -1. Perform a [cutover](#cutover-strategy) by resuming application traffic, now to CockroachDB. +1. Set up the [CockroachDB Live Migration Service (MOLT LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) to proxy for application traffic between your source database and CockroachDB. Do **not** shadow the application traffic. +1. Use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. Use the tool to [**replicate ongoing changes**]({% link {{ page.version.version }}/molt-fetch.md %}#replication) after it performs the initial load of data into CockroachDB. +1. As the data is migrating, use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. +1. After nearly all data from your source database has been moved to CockroachDB (for example, with a <1-second delay or <1000 rows), use MOLT LMS to begin a [*consistent cutover*]({% link {{ page.version.version }}/live-migration-service.md %}#consistent-cutover) and stop application traffic to your source database. **This begins downtime.** +1. Wait for MOLT Fetch to finish replicating changes to CockroachDB. +1. Use MOLT LMS to commit the [consistent cutover]({% link {{ page.version.version }}/live-migration-service.md %}#consistent-cutover). This resumes application traffic, now to CockroachDB. To achieve zero downtime with inconsistency: -1. {% include {{ page.version.version }}/migration/load-data-third-party.md %} Select the tool's option to replicate ongoing changes after performing the initial load of data into CockroachDB. +1. Set up the [CockroachDB Live Migration Service (MOLT LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) to proxy for application traffic between your source database and CockroachDB. Use a [shadowing mode]({% link {{ page.version.version }}/live-migration-service.md %}#shadowing-modes) to run application queries simultaneously on your source database and CockroachDB. +1. Use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. Use the tool to **replicate ongoing changes** after performing the initial load of data into CockroachDB. 1. As the data is migrating, you can use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. -1. Once nearly all data from your source database has been moved to CockroachDB (for example, with a <1 second delay or <1000 rows), perform a [cutover](#cutover-strategy) by pointing application traffic to CockroachDB. +1. After nearly all data from your source database has been moved to CockroachDB (for example, with a <1 second delay or <1000 rows), perform an [*immediate cutover*](#cutover-strategy) by pointing application traffic to CockroachDB. 1. Manually reconcile any inconsistencies caused by writes that were not replicated during the cutover. 1. Close the connection to the source database when you are ready to finish the migration. diff --git a/src/current/v23.2/molt-fetch.md b/src/current/v23.2/molt-fetch.md index c4879ad5e27..7d4098b7d23 100644 --- a/src/current/v23.2/molt-fetch.md +++ b/src/current/v23.2/molt-fetch.md @@ -5,13 +5,9 @@ toc: true docs_area: migrate --- -{{site.data.alerts.callout_info}} -{% include feature-phases/preview.md %} -{{site.data.alerts.end}} - MOLT Fetch moves data from a source database into CockroachDB as part of a [database migration]({% link {{ page.version.version }}/migration-overview.md %}). -MOLT Fetch can use `IMPORT INTO` or `COPY FROM` to move the source data to CockroachDB via cloud storage (Google Cloud Storage or Amazon S3), a local file server, or directly without an intermediate store. For details, see [Usage](#usage). +MOLT Fetch uses [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}) to move the source data to cloud storage (Google Cloud Storage or Amazon S3), a local file server, or local memory. Once the data is exported, MOLT Fetch loads the data onto a target CockroachDB database. For details, see [Usage](#usage). ## Supported databases @@ -31,21 +27,27 @@ To install MOLT Fetch, download the binary that matches your system. To download | Linux | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-arm64.tgz) | | Mac | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-arm64.tgz) | -For previous binaries, see the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). For releases v0.0.6 and earlier, see the [MOLT repository](https://github.com/cockroachdb/molt/releases). +For previous binaries, refer to the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). + +{{site.data.alerts.callout_info}} +MOLT Fetch is supported on Red Hat Enterprise Linux (RHEL) 9 and above. +{{site.data.alerts.end}} ## Setup Complete the following items before using MOLT Fetch: -- Ensure that the source and target schemas are identical. Tables with mismatching columns may only be partially migrated. +- Follow the recommendations in [Best practices](#best-practices) and [Security recommendations](#security-recommendations). -- Ensure that the SQL user running MOLT Fetch has the required privileges to run [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}#required-privileges) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}#required-privileges) statements, depending on your intended [mode](#fetch-mode). +- Ensure that the source and target schemas are identical, unless you enable automatic schema creation with the [`'drop-on-target-and-recreate'`](#target-table-handling) option. If you are creating the target schema manually, review the behaviors in [Mismatch handling](#mismatch-handling). -- To enable the [CDC cursor](#cdc-cursor) for ongoing replication: +- Ensure that the SQL user running MOLT Fetch has [`SELECT` privileges]({% link {{ page.version.version }}/grant.md %}#supported-privileges) on the source and target CockroachDB databases, along with the required privileges to run [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}#required-privileges) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}#required-privileges) (depending on the [fetch mode](#fetch-mode)) on CockroachDB, as described on their respective pages. - - If you are migrating from PostgreSQL, enable logical replication. Set [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) to `logical` in `postgresql.conf` or in the SQL shell. +- If you plan to use continuous replication (using either [`--ongoing-replication`](#replication) or the [CDC cursor](#cdc-cursor)): - - If you are migrating from MySQL, enable [GTID](https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html) consistency. Set `gtid-mode` and `enforce-gtid-consistency` to `ON` in `mysql.cnf`, in the SQL shell, or as flags in the `mysql` start command. + - If you are migrating from PostgreSQL, enable logical replication. In `postgresql.conf` or in the SQL shell, set [`wal_level`](https://www.postgresql.org/docs/current/runtime-config-wal.html) to `logical`. + + - If you are migrating from MySQL, enable [GTID](https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html) consistency. In `mysql.cnf`, in the SQL shell, or as flags in the `mysql` start command, set `gtid-mode` and `enforce-gtid-consistency` to `ON` and set `binlog_row_metadata` to `full`. - Percent-encode the connection strings for the source database and [CockroachDB]({% link {{ page.version.version }}/connect-to-the-database.md %}). This ensures that the MOLT tools can parse special characters in your password. @@ -67,64 +69,155 @@ Complete the following items before using MOLT Fetch: postgres://postgres:a%2452%26@localhost:5432/replicationload ~~~ -- If you are using Amazon S3 for [cloud storage](#cloud-storage): + - If you are using Amazon S3 for [cloud storage](#cloud-storage): - - Ensure that the environment variable and access tokens are set appropriately in the terminal running `molt fetch`. For example: + - Ensure that the environment variable and access tokens are set appropriately in the terminal running `molt fetch`. For example: - {% include_cached copy-clipboard.html %} - ~~~ shell - export AWS_REGION='us-east-1' - export AWS_SECRET_ACCESS_KEY='key' - export AWS_ACCESS_KEY_ID='id' - ~~~ + {% include_cached copy-clipboard.html %} + ~~~ shell + export AWS_REGION='us-east-1' + export AWS_SECRET_ACCESS_KEY='key' + export AWS_ACCESS_KEY_ID='id' + ~~~ - - Ensure the S3 bucket is created and accessible to CockroachDB. + - Ensure the S3 bucket is created and accessible to CockroachDB. -- If you are using Google Cloud Storage for [cloud storage](#cloud-storage): + - If you are using Google Cloud Storage for [cloud storage](#cloud-storage): - - Ensure that your local environment is authenticated using [Application Default Credentials](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login): + - Ensure that your local environment is authenticated using [Application Default Credentials](https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login): - {% include_cached copy-clipboard.html %} - ~~~ shell - gcloud init - gcloud auth application-default login - ~~~ + {% include_cached copy-clipboard.html %} + ~~~ shell + gcloud init + gcloud auth application-default login + ~~~ + + - Ensure the Google Cloud Storage bucket is created and accessible to CockroachDB. + +## Best practices + +- To prevent connections from terminating prematurely during data export, set the following to high values on the source database: + + - **Maximum allowed number of connections:** MOLT Fetch can export data across multiple connections. The number of connections it will create is the number of shards ([`--export-concurrency`](#global-flags)) multiplied by the number of tables ([`--table-concurrency`](#global-flags)) being exported concurrently. + - **Maximum lifetime of a connection:** This is particularly important for MySQL sources, which can only use a single connection to move data. See the following note. + +- If a MySQL database is set as a [source](#source-and-target-databases), the [`--table-concurrency`](#global-flags) and [`--export-concurrency`](#global-flags) flags **cannot** be set above `1`. If these values are changed, MOLT Fetch returns an error. This guarantees consistency when moving data from MySQL, due to MySQL limitations. MySQL data is migrated to CockroachDB one table and shard at a time, using [`WITH CONSISTENT SNAPSHOT`](https://dev.mysql.com/doc/refman/8.0/en/commit.html) transactions. + +- To prevent memory outages during data export of tables with large rows, estimate the amount of memory used to export a table: + + ~~~ + --row-batch-size * --export-concurrency * average size of the table rows + ~~~ + + If you are exporting more than one table at a time (i.e., [`--table-concurrency`](#global-flags) is set higher than `1`), add the estimated memory usage for the tables with the largest row sizes. Ensure that you have sufficient memory to run `molt fetch`, and adjust `--row-batch-size` accordingly. + +- If a table in the source database is much larger than the other tables, [filter and export the largest table](#schema-and-table-selection) in its own `molt fetch` task. Repeat this for each of the largest tables. Then export the remaining tables in another task. + +- When using [`IMPORT INTO` mode](#fetch-mode) to load tables into CockroachDB, if the fetch process terminates before the import job completes, the hanging import job on the target database will keep the table offline. To make this table accessible again, [manually resume or cancel the job]({% link {{ page.version.version }}/import-into.md %}#view-and-control-import-jobs). Then resume `molt fetch` using [continuation](#fetch-continuation), or restart the process from the beginning. + +## Security recommendations + +Cockroach Labs **strongly** recommends the following: + +### Secure connections + +- Use secure connections to the source and [target CockroachDB database]({% link {{ page.version.version }}/connection-parameters.md %}#additional-connection-parameters) whenever possible. +- By default, insecure connections (i.e., `sslmode=disable` on PostgreSQL; `sslmode` not set on MySQL) are disallowed. When using an insecure connection, `molt fetch` returns an error. To override this check, you can enable the `--allow-tls-mode-disable` flag. Do this **only** for testing, or if a secure SSL/TLS connection to the source or target database is not possible. + +### Connection strings + +- Avoid plaintext connection strings. +- Provide your connection strings as environment variables. +- If possible within your security infrastructure, use an external secrets manager to load the environment variables from stored secrets. + + For example, to export connection strings as environment variables: - - Ensure the Google Cloud Storage bucket is created and accessible to CockroachDB. + ~~~ shell + export SOURCE="postgres://postgres:postgres@localhost:5432/molt?sslmode=verify-full" + export TARGET="postgres://root@localhost:26257/molt?sslmode=verify-full" + ~~~ + + Afterward, to pass the environment variables in `molt fetch` commands: + + ~~~ shell + molt fetch \ + --source "$SOURCE" \ + --target "$TARGET" \ + --table-filter 'employees' \ + --bucket-path 's3://molt-test' \ + --table-handling truncate-if-exists + ~~~ + +### Secure cloud storage + +- When using [cloud storage](#cloud-storage) for your intermediate store, ensure that access control is properly configured. Refer to the [GCP](https://cloud.google.com/storage/docs/access-control) or [AWS](https://docs.aws.amazon.com/AmazonS3/latest/userguide/security-iam.html) documentation. +- Do not use public cloud storage in production. + +### Perform a dry run + +To verify that your connections and configuration work properly, run MOLT Fetch in a staging environment before moving any data in production. Use a test or development environment that is as similar as possible to production. + +## Commands + +| Command | Usage | +|---------|---------------------------------------------------------------------------------------------------| +| `fetch` | Start the fetch process. This loads data from a source database to a target CockroachDB database. | + +### Subcommands + +| Command | Usage | +|--------------|----------------------------------------------------------------------| +| `tokens list` | List active [continuation tokens](#list-active-continuation-tokens). | ## Flags -| Flag | Description | -|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `--source` | (Required) Connection string for the source database. For details, see [Source and target databases](#source-and-target-databases). | -| `--target` | (Required) Connection string for the target database. For details, see [Source and target databases](#source-and-target-databases). | -| `--bucket-path` | The path within the [cloud storage](#cloud-storage) bucket where intermediate files are written (e.g., `'s3://bucket/path'` or `'gs://bucket/path'`). | -| `--cleanup` | Whether to delete intermediate files after moving data using [cloud or local storage](#data-path). **Note:** Cleanup does not occur on [continuation](#fetch-continuation). | -| `--compression` | Compression method for data when using [`IMPORT INTO` mode](#fetch-mode) (`gzip`/`none`).

**Default:** `gzip` | -| `--continuation-file-name` | Restart fetch at the specified filename if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | -| `--continuation-token` | Restart fetch at a specific table, using the specified continuation token, if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | -| `--direct-copy` | Enables [direct copy mode](#fetch-mode), which copies data directly from source to target without using an intermediate store. | -| `--export-concurrency` | Number of concurrent threads to use for data export. **Note:** This number will be multiplied by the number of tables being moved in `--table-concurrency`. Ensure your machine has sufficient resources to handle this level of concurrency.

**Default:** `4` | -| `--fetch-id` | Restart fetch process corresponding to the specified ID. If `--continuation-file-name` or `--continuation-token` are not specified, fetch restarts for all failed tables. | -| `--flush-rows` | Number of rows before the source data is flushed to intermediate files. **Note:** If `--flush-size` is also specified, the fetch behavior is based on the flag whose criterion is met first. | -| `--flush-size` | Size (in bytes) before the source data is flushed to intermediate files. **Note:** If `--flush-rows` is also specified, the fetch behavior is based on the flag whose criterion is met first. | -| `--local-path` | The path within the [local file server](#local-file-server) where intermediate files are written (e.g., `data/migration/cockroach`). `--local-path-listen-addr` must be specified. | -| `--local-path-crdb-access-addr` | Address of a [local file server](#local-file-server) that is reachable by CockroachDB. This flag is only necessary if CockroachDB cannot reach the local address specified with `--local-path-listen-addr` (e.g., when moving data to a CockroachDB {{ site.data.products.cloud }} deployment).

**Default:** Value of `--local-path-listen-addr`. `--local-path` and `--local-path-listen-addr` must be specified. | -| `--local-path-listen-addr` | Write intermediate files to a [local file server](#local-file-server) at the specified address (e.g., `'localhost:3000'`). `--local-path` must be specified. | -| `--log-file` | Write messages to the specified log filename. If not specified, messages are only written to `stdout`. | -| `--logging` | Level at which to log messages (`'trace'`/`'debug'`/`'info'`/`'warn'`/`'error'`/`'fatal'`/`'panic'`).

**Default:** `'info'` | -| `--metrics-listen-addr` | Address of the metrics endpoint.

**Default:** `'127.0.0.1:3030'` | -| `--pglogical-replication-slot-drop-if-exists` | Drop the replication slot, if specified with `--pglogical-replication-slot-name`. Otherwise, the default replication slot is not dropped. | -| `--pglogical-replication-slot-name` | The name of a replication slot to create before taking a snapshot of data (e.g., `'fetch'`). This flag is only necessary if you want to use a replication slot other than the default slot. | -| `--pglogical-replication-slot-plugin` | The output plugin used for logical replication under `--pglogical-replication-slot-name`.

**Default:** `pgoutput` | -| `--pprof-listen-addr` | Address of the pprof endpoint.

**Default:** `'127.0.0.1:3031'` | -| `--row-batch-size` | Number of rows to select at a time for export from the source database.

**Default:** `100000` | -| `--schema-filter` | Move schemas that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | -| `--table-concurrency` | Number of tables to move at a time. **Note:** This number will be multiplied by the value of `--export-concurrency`. Ensure your machine has sufficient resources to handle this level of concurrency.

**Default:** 4 | -| `--table-filter` | Move tables that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | -| `--table-handling` | How tables are initialized on the target database (`'none'`/`'drop-on-target-and-recreate'`/`'truncate-if-exists'`). For details, see [Target table handling](#target-table-handling).

**Default:** `'none'` | -| `--use-console-writer` | Use the console writer, which has cleaner log output but introduces more latency.

**Default:** `false` (log as structured JSON) | -| `--use-copy` | Use [`COPY FROM` mode](#fetch-mode) to move data. This makes tables queryable during data load, but is slower than `IMPORT INTO` mode. For details, see [Fetch mode](#fetch-mode). | +### Global flags + +| Flag | Description | +|-----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `--source` | (Required) Connection string for the source database. For details, see [Source and target databases](#source-and-target-databases). | +| `--target` | (Required) Connection string for the target database. For details, see [Source and target databases](#source-and-target-databases). | +| `--allow-tls-mode-disable` | Allow insecure connections to databases. Secure SSL/TLS connections should be used by default. This should be enabled **only** if secure SSL/TLS connections to the source or target database are not possible. | +| `--bucket-path` | The path within the [cloud storage](#cloud-storage) bucket where intermediate files are written (e.g., `'s3://bucket/path'` or `'gs://bucket/path'`). | +| `--cleanup` | Whether to delete intermediate files after moving data using [cloud or local storage](#data-path). **Note:** Cleanup does not occur on [continuation](#fetch-continuation). | +| `--compression` | Compression method for data when using [`IMPORT INTO` mode](#fetch-mode) (`gzip`/`none`).

**Default:** `gzip` | +| `--continuation-file-name` | Restart fetch at the specified filename if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | +| `--continuation-token` | Restart fetch at a specific table, using the specified continuation token, if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | +| `--crdb-pts-duration` | The duration for which each timestamp used in data export from a CockroachDB source is protected from garbage collection. This ensures that the data snapshot remains consistent. For example, if set to `24h`, each timestamp is protected for 24 hours from the initiation of the export job. This duration is extended at regular intervals specified in `--crdb-pts-refresh-interval`.

**Default:** `24h0m0s` | +| `--crdb-pts-refresh-interval` | The frequency at which the protected timestamp's validity is extended. This interval maintains protection of the data snapshot until data export from a CockroachDB source is completed. For example, if set to `10m`, the protected timestamp's expiration will be extended by the duration specified in `--crdb-pts-duration` (e.g., `24h`) every 10 minutes while export is not complete.

**Default:** `10m0s` | +| `--direct-copy` | Enables [direct copy mode](#fetch-mode), which copies data directly from source to target without using an intermediate store. | +| `--export-concurrency` | Number of shards to export at a time, each on a dedicated thread. **Note:** The number of concurrent threads is the product of `--export-concurrency` and `--table-concurrency`. See [Best practices](#best-practices).

This value **cannot** be set higher than `1` when moving data from MySQL. Refer to [Best practices](#best-practices).

**Default:** `4` with a PostgreSQL source; `1` with a MySQL source | +| `--fetch-id` | Restart fetch process corresponding to the specified ID. If `--continuation-file-name` or `--continuation-token` are not specified, fetch restarts for all failed tables. | +| `--flush-rows` | Number of rows before the source data is flushed to intermediate files. **Note:** If `--flush-size` is also specified, the fetch behavior is based on the flag whose criterion is met first. | +| `--flush-size` | Size (in bytes) before the source data is flushed to intermediate files. **Note:** If `--flush-rows` is also specified, the fetch behavior is based on the flag whose criterion is met first. | +| `--local-path` | The path within the [local file server](#local-file-server) where intermediate files are written (e.g., `data/migration/cockroach`). `--local-path-listen-addr` must be specified. | +| `--local-path-crdb-access-addr` | Address of a [local file server](#local-file-server) that is reachable by CockroachDB. This flag is only necessary if CockroachDB cannot reach the local address specified with `--local-path-listen-addr` (e.g., when moving data to a CockroachDB {{ site.data.products.cloud }} deployment).

**Default:** Value of `--local-path-listen-addr`. `--local-path` and `--local-path-listen-addr` must be specified. | +| `--local-path-listen-addr` | Write intermediate files to a [local file server](#local-file-server) at the specified address (e.g., `'localhost:3000'`). `--local-path` must be specified. | +| `--log-file` | Write messages to the specified log filename. If not specified, messages are only written to `stdout`. | +| `--logging` | Level at which to log messages (`'trace'`/`'debug'`/`'info'`/`'warn'`/`'error'`/`'fatal'`/`'panic'`).

**Default:** `'info'` | +| `--metrics-listen-addr` | Address of the metrics endpoint.

**Default:** `'127.0.0.1:3030'` | +| `--non-interactive` | Run the fetch process without interactive prompts. This is recommended **only** when running `molt fetch` in an automated process (i.e., a job or continuous integration). | +| `--ongoing-replication` | Enable continuous [replication](#replication) to begin after the fetch process succeeds (i.e., initial source data is loaded into CockroachDB). | +| `--pglogical-replication-slot-drop-if-exists` | Drop the replication slot, if specified with `--pglogical-replication-slot-name`. Otherwise, the default replication slot is not dropped. | +| `--pglogical-replication-slot-name` | The name of a replication slot to create before taking a snapshot of data (e.g., `'fetch'`). **Required** in order to perform continuous [replication](#replication) from a source PostgreSQL database. | +| `--pglogical-replication-slot-plugin` | The output plugin used for logical replication under `--pglogical-replication-slot-name`.

**Default:** `pgoutput` | +| `--pprof-listen-addr` | Address of the pprof endpoint.

**Default:** `'127.0.0.1:3031'` | +| `--replicator-flags` | If continuous [replication](#replication) is enabled with `--ongoing-replication`, specify Replicator flags ([PostgreSQL](https://github.com/cockroachdb/replicator/wiki/PGLogical#postgresql-logical-replication) or [MySQL](https://github.com/cockroachdb/replicator/wiki/MYLogical#mysqlmariadb-replication)) to override. | +| `--row-batch-size` | Number of rows per shard to export at a time. See [Best practices](#best-practices).

**Default:** `100000` | +| `--schema-filter` | Move schemas that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | +| `--table-concurrency` | Number of tables to export at a time. **Note:** The number of concurrent threads is the product of `--export-concurrency` and `--table-concurrency`. See [Best practices](#best-practices).

This value **cannot** be set higher than `1` when moving data from MySQL. See [Best practices](#best-practices).

**Default:** `4` with a PostgreSQL source; `1` with a MySQL source | +| `--table-filter` | Move tables that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | +| `--table-handling` | How tables are initialized on the target database (`'none'`/`'drop-on-target-and-recreate'`/`'truncate-if-exists'`). For details, see [Target table handling](#target-table-handling).

**Default:** `'none'` | +| `--type-map-file` | Path to a JSON file that contains explicit type mappings for automatic schema creation, when enabled with `--table-handling 'drop-on-target-and-recreate'`. For details on the JSON format and valid type mappings, see [type mapping](#type-mapping). | +| `--use-console-writer` | Use the console writer, which has cleaner log output but introduces more latency.

**Default:** `false` (log as structured JSON) | +| `--use-copy` | Use [`COPY FROM` mode](#fetch-mode) to move data. This makes tables queryable during data load, but is slower than `IMPORT INTO` mode. For details, see [Fetch mode](#fetch-mode). | + +### `tokens list` flags + +| Flag | Description | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `--conn-string` | (Required) Connection string for the target database. For details, see [List active continuation tokens](#list-active-continuation-tokens). | +| `-n`, `--num-results` | Number of results to return. | ## Usage @@ -132,6 +225,10 @@ The following sections describe how to use the `molt fetch` [flags](#flags). ### Source and target databases +{{site.data.alerts.callout_success}} +Follow the recommendations in [Connection strings](#connection-strings). +{{site.data.alerts.end}} + `--source` specifies the connection string of the source database. PostgreSQL or CockroachDB: @@ -157,11 +254,11 @@ MySQL: ### Fetch mode -MOLT Fetch can use either [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}) to move data to CockroachDB. +MOLT Fetch can use either [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}) to load data into CockroachDB. By default, MOLT Fetch uses `IMPORT INTO`: -- `IMPORT INTO` mode achieves the highest throughput, but [requires taking the tables **offline**]({% link {{ page.version.version }}/import-into.md %}#considerations) to achieve its import speed. +- `IMPORT INTO` mode achieves the highest throughput, but [requires taking the tables **offline**]({% link {{ page.version.version }}/import-into.md %}#considerations) to achieve its import speed. Tables are taken back online once an [import job]({% link {{ page.version.version }}/import-into.md %}#view-and-control-import-jobs) completes successfully. See [Best practices](#best-practices). - `IMPORT INTO` mode supports compression using the `--compression` flag, which reduces the amount of storage used. `--use-copy` configures MOLT Fetch to use `COPY FROM`: @@ -179,6 +276,10 @@ MOLT Fetch can move the source data to CockroachDB via [cloud storage](#cloud-st #### Cloud storage +{{site.data.alerts.callout_success}} +Follow the recommendations in [Secure cloud storage](#secure-cloud-storage). +{{site.data.alerts.end}} + `--bucket-path` specifies that MOLT Fetch should write intermediate files to a path within a [Google Cloud Storage](https://cloud.google.com/storage/docs/buckets) or [Amazon S3](https://aws.amazon.com/s3/) bucket to which you have the necessary permissions. For example: Google Cloud Storage: @@ -275,23 +376,139 @@ To drop existing tables and create new tables before loading the data, use `'dro --table-handling 'drop-on-target-and-recreate' ~~~ -With each option, MOLT Fetch creates a new CockroachDB table to load the source data if one does not exist. +When using the `'drop-on-target-and-recreate'` option, MOLT Fetch creates a new CockroachDB table to load the source data if one does not already exist. To guide the automatic schema creation, you can [explicitly map source types to CockroachDB types](#type-mapping). + +#### Mismatch handling + +If either [`'none'`](#target-table-handling) or [`'truncate-if-exists'`](#target-table-handling) is set, `molt fetch` loads data into the existing tables on the target CockroachDB database. If the target schema mismatches the source schema, `molt fetch` will exit early in [certain cases](#exit-early), and will need to be re-run from the beginning. + +{{site.data.alerts.callout_info}} +This does not apply when [`'drop-on-target-and-recreate'`](#target-table-handling) is specified, since this mode automatically creates a compatible CockroachDB schema. +{{site.data.alerts.end}} + +`molt fetch` exits early in the following cases, and will output a log with a corresponding `mismatch_tag` and `failable_mismatch` set to `true`: + +- A source table is missing a primary key. +- A source and table primary key have mismatching types. +- A [`STRING`]({% link {{ page.version.version }}/string.md %}) primary key has a different [collation]({% link {{ page.version.version }}/collate.md %}) on the source and target. +- A source and target column have mismatching types that are not [allowable mappings](#type-mapping). +- A target table is missing a column that is in the corresponding source table. +- A source column is nullable, but the corresponding target column is not nullable (i.e., the constraint is more strict on the target). + +`molt fetch` can continue in the following cases, and will output a log with a corresponding `mismatch_tag` and `failable_mismatch` set to `false`: + +- A target table has a column that is not in the corresponding source table. +- A source column has a `NOT NULL` constraint, and the corresponding target column is nullable (i.e., the constraint is less strict on the target). +- A [`DEFAULT`]({% link {{ page.version.version }}/default-value.md %}), [`CHECK`]({% link {{ page.version.version }}/check.md %}), [`FOREIGN KEY`]({% link {{ page.version.version }}/foreign-key.md %}), or [`UNIQUE`]({% link {{ page.version.version }}/unique.md %}) constraint is specified on a target column and not on the source column. + +#### Type mapping + +If [`'drop-on-target-and-recreate'`](#target-table-handling) is set, MOLT Fetch automatically creates a CockroachDB schema that is compatible with the source data. The column types are determined as follows: + +- PostgreSQL types are mapped to existing CockroachDB [types]({% link {{ page.version.version }}/data-types.md %}) that have the same [`OID`]({% link {{ page.version.version }}/oid.md %}). +- The following MySQL types are mapped to corresponding CockroachDB types: + + | MySQL type | CockroachDB type | + |-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------| + | `CHAR`, `CHARACTER`, `VARCHAR`, `NCHAR`, `NVARCHAR` | [`VARCHAR`]({% link {{ page.version.version }}/string.md %}) | + | `TINYTEXT`, `TEXT`, `MEDIUMTEXT`, `LONGTEXT` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | + | `GEOMETRY` | [`GEOMETRY`]({% link {{ page.version.version }}/architecture/glossary.md %}#geometry) | + | `LINESTRING` | [`LINESTRING`]({% link {{ page.version.version }}/linestring.md %}) | + | `POINT` | [`POINT`]({% link {{ page.version.version }}/point.md %}) | + | `POLYGON` | [`POLYGON`]({% link {{ page.version.version }}/polygon.md %}) | + | `MULTIPOINT` | [`MULTIPOINT`]({% link {{ page.version.version }}/multipoint.md %}) | + | `MULTILINESTRING` | [`MULTILINESTRING`]({% link {{ page.version.version }}/multilinestring.md %}) | + | `MULTIPOLYGON` | [`MULTIPOLYGON`]({% link {{ page.version.version }}/multipolygon.md %}) | + | `GEOMETRYCOLLECTION`, `GEOMCOLLECTION` | [`GEOMETRYCOLLECTION`]({% link {{ page.version.version }}/geometrycollection.md %}) | + | `JSON` | [`JSONB`]({% link {{ page.version.version }}/jsonb.md %}) | + | `TINYINT`, `INT1` | [`INT2`]({% link {{ page.version.version }}/int.md %}) | + | `BLOB` | [`BYTES`]({% link {{ page.version.version }}/bytes.md %}) | + | `SMALLINT`, `INT2` | [`INT2`]({% link {{ page.version.version }}/int.md %}) | + | `MEDIUMINT`, `INT`, `INTEGER`, `INT4` | [`INT4`]({% link {{ page.version.version }}/int.md %}) | + | `BIGINT`, `INT8` | [`INT`]({% link {{ page.version.version }}/int.md %}) | + | `FLOAT` | [`FLOAT4`]({% link {{ page.version.version }}/float.md %}) | + | `DOUBLE` | [`FLOAT`]({% link {{ page.version.version }}/float.md %}) | + | `DECIMAL`, `NUMERIC`, `REAL` | [`DECIMAL`]({% link {{ page.version.version }}/decimal.md %}) (Negative scale values are autocorrected to `0`) | + | `BINARY`, `VARBINARY` | [`BYTES`]({% link {{ page.version.version }}/bytes.md %}) | + | `DATETIME` | [`TIMESTAMP`]({% link {{ page.version.version }}/timestamp.md %}) | + | `TIMESTAMP` | [`TIMESTAMPTZ`]({% link {{ page.version.version }}/timestamp.md %}) | + | `TIME` | [`TIME`]({% link {{ page.version.version }}/time.md %}) | + | `BIT` | [`VARBIT`]({% link {{ page.version.version }}/bit.md %}) | + | `DATE` | [`DATE`]({% link {{ page.version.version }}/date.md %}) | + | `TINYBLOB`, `MEDIUMBLOB`, `LONGBLOB` | [`BYTES`]({% link {{ page.version.version }}/bytes.md %}) | + | `BOOL`, `BOOLEAN` | [`BOOL`]({% link {{ page.version.version }}/bool.md %}) | + | `ENUM` | [`ANY_ENUM`]({% link {{ page.version.version }}/enum.md %}) | + +- To override the default mappings for automatic schema creation, you can map source to target CockroachDB types explicitly. These are specified using a JSON file and `--type-map-file`. The allowable custom mappings are valid CockroachDB aliases, casts, and the following mappings specific to MOLT Fetch and [Verify]({% link {{ page.version.version }}/molt-verify.md %}): + + - [`TIMESTAMP`]({% link {{ page.version.version }}/timestamp.md %}) <> [`TIMESTAMPTZ`]({% link {{ page.version.version }}/timestamp.md %}) + - [`VARCHAR`]({% link {{ page.version.version }}/string.md %}) <> [`UUID`]({% link {{ page.version.version }}/uuid.md %}) + - [`BOOL`]({% link {{ page.version.version }}/bool.md %}) <> [`INT2`]({% link {{ page.version.version }}/int.md %}) + - [`VARBIT`]({% link {{ page.version.version }}/bit.md %}) <> [`TEXT`]({% link {{ page.version.version }}/string.md %}) + - [`JSONB`]({% link {{ page.version.version }}/jsonb.md %}) <> [`TEXT`]({% link {{ page.version.version }}/string.md %}) + - [`INET`]({% link {{ page.version.version }}/inet.md %}) <> [`TEXT`]({% link {{ page.version.version }}/string.md %}) + +`--type-map-file` specifies the path to the JSON file containing the explicit type mappings. For example: + +{% include_cached copy-clipboard.html %} +~~~ +--type-map-file 'type-mappings.json' +~~~ + +The JSON is formatted as follows: + +~~~ json +[ + { + "table": "public.t1", + "column-type-map": [ + { + "column": "*", + "type-kv": { + "source-type": "int", + "crdb-type": "INT2" + } + }, + { + "column": "name", + "type-kv": { + "source-type": "varbit", + "crdb-type": "string" + } + } + ] + } +] +~~~ + +- `table` specifies the table that will use the custom type mappings in `column-type-map`, written as `{schema}.{table}`. +- `column` specifies the column that will use the custom type mapping in `type-kv`. If `*` is specified, then all columns in the `table` with the matching `source-type` are converted. +- `type-kv` specifies the `source-type` that maps to the target `crdb-type`. ### Fetch continuation -If `molt fetch` exits with an error after loading data from [cloud](#cloud-storage) or [local storage](#local-file-server), you can continue the process from the *continuation point* where it was interrupted. +If MOLT Fetch fails while loading data into CockroachDB from intermediate files, it exits with an error message, fetch ID, and [continuation token](#list-active-continuation-tokens) for each table that failed to load on the target database. You can use this information to continue the process from the *continuation point* where it was interrupted. For an example, see [Continue fetch after encountering an error](#continue-fetch-after-encountering-an-error). -To retry all data starting from the continuation point, include `--fetch-id` and specify the process ID from the `molt fetch` output. +Continuation is only possible under the following conditions: + +- All data has been exported from the source database into intermediate files on [cloud](#cloud-storage) or [local storage](#local-file-server). +- The *initial load* of source data to the target CockroachDB database is incomplete. This means that ongoing [replication](#replication) of source data has not begun. + +{{site.data.alerts.callout_info}} +Only one fetch ID and set of continuation tokens, each token corresponding to a table, are active at any time. See [List active continuation tokens](#list-active-continuation-tokens). +{{site.data.alerts.end}} + +To retry all data starting from the continuation point, reissue the `molt fetch` command and include the `--fetch-id`. {% include_cached copy-clipboard.html %} ~~~ --fetch-id d44762e5-6f70-43f8-8e15-58b4de10a007 ~~~ -To retry a specific table that failed, include both `--fetch-id` and `--continuation-token`. The latter flag specifies a token string that corresponds to a specific table on the source database. A continuation token is written in the `molt fetch` output for each failed table. If the fetch process encounters a subsequent error, it generates a new token for each failed table. +To retry a specific table that failed, include both `--fetch-id` and `--continuation-token`. The latter flag specifies a token string that corresponds to a specific table on the source database. A continuation token is written in the `molt fetch` output for each failed table. If the fetch process encounters a subsequent error, it generates a new token for each failed table. See [List active continuation tokens](#list-active-continuation-tokens). {{site.data.alerts.callout_info}} -This will retry only the table that corresponds to the continuation token. If the fetch process succeeds, there may still be source data that is not yet loaded onto CockroachDB. +This will retry only the table that corresponds to the continuation token. If the fetch process succeeds, there may still be source data that is not yet loaded into CockroachDB. {{site.data.alerts.end}} {% include_cached copy-clipboard.html %} @@ -300,18 +517,71 @@ This will retry only the table that corresponds to the continuation token. If th --continuation-token 011762e5-6f70-43f8-8e15-58b4de10a007 ~~~ -To retry all data starting from a specific file, include both `--fetch-id` and `--continuation-file-name`. The latter flag specifies the filename of an intermediate file in [cloud or local storage](#data-path). All filenames are prepended with `part_` and have the `.tar.gz` or `.csv` extension, depending on compression type (gzip by default). For example: +To retry all data starting from a specific file, include both `--fetch-id` and `--continuation-file-name`. The latter flag specifies the filename of an intermediate file in [cloud or local storage](#data-path). All filenames are prepended with `part_` and have the `.csv.gz` or `.csv` extension, depending on compression type (gzip by default). For example: {% include_cached copy-clipboard.html %} ~~~ --fetch-id d44762e5-6f70-43f8-8e15-58b4de10a007 ---continuation-file-name part_00000003.tar.gz +--continuation-file-name part_00000003.csv.gz ~~~ {{site.data.alerts.callout_info}} Continuation is not possible when using [direct copy mode](#direct-copy). {{site.data.alerts.end}} +#### List active continuation tokens + +To view all active continuation tokens, issue a `molt fetch tokens list` command along with `--conn-string`, which specifies the [connection string]({% link {{ page.version.version }}/connection-parameters.md %}#connect-using-a-url) for the target CockroachDB database. For example: + +{% include_cached copy-clipboard.html %} +~~~ shell +molt fetch tokens list \ +--conn-string 'postgres://root@localhost:26257/defaultdb?sslmode=verify-full' +~~~ + +~~~ ++--------------------------------------+--------------------------------------+------------------+----------------------+ +| ID | FETCH ID | TABLE NAME | FILE NAME | ++--------------------------------------+--------------------------------------+------------------+----------------------+ +| f6f0284c-d9c1-43c9-8fde-af609d0dbd82 | 66443597-5689-4df3-a7b9-9fc5e27180eb | public.employees | part_00000001.csv.gz | ++--------------------------------------+--------------------------------------+------------------+----------------------+ +Continuation Tokens. +~~~ + +### Replication + +`--ongoing-replication` enables logical replication from the source database to the target CockroachDB database. + +{% include_cached copy-clipboard.html %} +~~~ +--ongoing-replication +~~~ + +When the `--ongoing-replication` flag is set, changes on the source database are continuously replicated on CockroachDB. This begins only after the fetch process succeeds—i.e., the initial source data is loaded into CockroachDB—as indicated by a `fetch complete` message in the output. + +Before using this feature, complete the following: + +- Install the Replicator binary. Before running `molt fetch` with continuous replication, [download the binary that matches your system](https://github.com/cockroachdb/replicator/wiki/Installing#automated-builds). The Replicator binary **must** be located in the same directory as your [`molt` binary](#installation). +- Configure the source PostgreSQL or MySQL database for continuous replication, as described in [Setup](#setup). + +If the source is a PostgreSQL database, you must also specify a replication slot name: + +{% include_cached copy-clipboard.html %} +~~~ +--ongoing-replication +--pglogical-replication-slot-name 'replication_slot' +~~~ + +To customize the Replicator behavior (an advanced use case), use `--replicator-flags` to specify one or more Replicator flags ([PostgreSQL](https://github.com/cockroachdb/replicator/wiki/PGLogical#postgresql-logical-replication) or [MySQL](https://github.com/cockroachdb/replicator/wiki/MYLogical#mysqlmariadb-replication)) to override. + +{% include_cached copy-clipboard.html %} +~~~ +--ongoing-replication +--replicator-flags "--applyTimeout '1h' --parallelism 64" +~~~ + +To cancel replication, enter `ctrl-c` to issue a `SIGTERM` signal. This returns an exit code `0`. If replication fails, a non-zero exit code is returned. + ### CDC cursor A change data capture (CDC) cursor is written to the output as `cdc_cursor` at the beginning and end of the fetch process. For example: @@ -324,13 +594,13 @@ You can use the `cdc_cursor` value with an external change data capture (CDC) to ## Examples -The following examples demonstrate how to issue `molt fetch` commands to load data onto CockroachDB. +The following examples demonstrate how to issue `molt fetch` commands to load data into CockroachDB. These examples assume that [secure connections](#secure-connections) to the source and target database are used. {{site.data.alerts.callout_success}} After successfully running MOLT Fetch, you can run [`molt verify`]({% link {{ page.version.version }}/molt-verify.md %}) to confirm that replication worked successfully without missing or mismatched rows. {{site.data.alerts.end}} -### Load PostgreSQL data via S3 +### Load PostgreSQL data via S3 with ongoing replication The following `molt fetch` command uses `IMPORT INTO` to load a subset of tables from a PostgreSQL database to CockroachDB. @@ -342,13 +612,17 @@ molt fetch \ --table-handling 'truncate-if-exists' \ --table-filter 'employees' \ --bucket-path 's3://migration/data/cockroach' \ ---cleanup +--cleanup \ +--pglogical-replication-slot-name 'replication_slot' \ +--ongoing-replication ~~~ - `--table-handling` specifies that existing tables on CockroachDB should be truncated before the source data is loaded. - `--table-filter` filters for tables with the `employees` string in the name. - `--bucket-path` specifies a directory on an [Amazon S3 bucket](#data-path) where intermediate files will be written. - `--cleanup` specifies that the intermediate files should be removed after the source data is loaded. +- `--pglogical-replication-slot-name` specifies a replication slot name to be created on the source PostgreSQL database. This is used in continuous [replication](#replication). +- `--ongoing-replication` starts continuous [replication](#replication) of data from the source database to CockroachDB after the fetch process succeeds. If the fetch process succeeds, the output displays a `fetch complete` message like the following: @@ -356,16 +630,27 @@ If the fetch process succeeds, the output displays a `fetch complete` message li {"level":"info","type":"summary","fetch_id":"f5cb422f-4bb4-4bbd-b2ae-08c4d00d1e7c","num_tables":1,"tables":["public.employees"],"cdc_cursor":"0/3F41E40","net_duration_ms":6752.847625,"net_duration":"000h 00m 06s","time":"2024-03-18T12:30:37-04:00","message":"fetch complete"} ~~~ +{{site.data.alerts.callout_info}} If the fetch process encounters an error, it will exit and can be [continued](#continue-fetch-after-encountering-an-error). +{{site.data.alerts.end}} -### Load MySQL data via GCP +Continuous [replication](#replication) begins immediately afterward: + +~~~ json +{"level":"info","time":"2024-05-13T14:33:07-04:00","message":"starting replicator"} +{"level":"info","time":"2024-05-13T14:36:22-04:00","message":"creating publication"} +~~~ + +To cancel replication, enter `ctrl-c` to issue a `SIGTERM` signal. + +### Load MySQL data via GCP with ongoing replication The following `molt fetch` command uses `COPY FROM` to load a subset of tables from a MySQL database to CockroachDB. {% include_cached copy-clipboard.html %} ~~~ shell molt fetch \ ---source 'mysql://root:password@localhost/molt' \ +--source 'mysql://root:password@localhost/molt?sslcert=.%2fsource_certs%2fclient.root.crt&sslkey=.%2fsource_certs%2fclient.root.key&sslmode=verify-full&sslrootcert=.%2fsource_certs%2fca.crt' \ --target 'postgres://root@localhost:26257/defaultdb?sslmode=verify-full' \ --table-handling 'truncate-if-exists' \ --table-filter 'employees' \ @@ -374,11 +659,13 @@ molt fetch \ --cleanup ~~~ +- `--source` specifies the MySQL connection string and the certificates in URL-encoded format. Secure connections should be used by default. Refer to [Best practices](#best-practices). - `--table-handling` specifies that existing tables on CockroachDB should be truncated before the source data is loaded. - `--table-filter` filters for tables with the `employees` string in the name. - `--bucket-path` specifies a directory on an [Google Cloud Storage bucket](#data-path) where intermediate files will be written. - `--use-copy` specifies that `COPY FROM` is used to load the tables, keeping the source tables online and queryable but loading the data more slowly than `IMPORT INTO`. - `--cleanup` specifies that the intermediate files should be removed after the source data is loaded. +- `--ongoing-replication` starts continuous [replication](#replication) of data from the source database to CockroachDB after the fetch process succeeds. If the fetch process succeeds, the output displays a `fetch complete` message like the following: @@ -386,7 +673,17 @@ If the fetch process succeeds, the output displays a `fetch complete` message li {"level":"info","type":"summary","fetch_id":"f5cb422f-4bb4-4bbd-b2ae-08c4d00d1e7c","num_tables":1,"tables":["public.employees"],"cdc_cursor":"0/3F41E40","net_duration_ms":6752.847625,"net_duration":"000h 00m 06s","time":"2024-03-18T12:30:37-04:00","message":"fetch complete"} ~~~ +{{site.data.alerts.callout_info}} If the fetch process encounters an error, it will exit and can be [continued](#continue-fetch-after-encountering-an-error). +{{site.data.alerts.end}} + +Continuous [replication](#replication) begins immediately afterward: + +~~~ json +{"level":"info","time":"2024-05-13T14:33:07-04:00","message":"starting replicator"} +~~~ + +To cancel replication, enter `ctrl-c` to issue a `SIGTERM` signal. ### Load CockroachDB data via direct copy @@ -395,18 +692,21 @@ The following `molt fetch` command uses `COPY FROM` to load all tables directly {% include_cached copy-clipboard.html %} ~~~ shell molt fetch \ ---source 'postgres://root@localhost:26257/defaultdb?sslmode=verify-full' \ ---target 'postgres://root@localhost:26258/defaultdb?sslmode=verify-full' \ +--source 'postgres://root@localhost:26257/defaultdb?sslmode=disable' \ +--target 'postgres://root@localhost:26258/defaultdb?sslmode=disable' \ --table-handling 'none' \ ---direct-copy +--direct-copy \ +--allow-tls-mode-disable ~~~ +- `--source` specifies `sslmode=disable` to establish an insecure connection. By default, insecure connections are disallowed and should be used **only** for testing or if a secure SSL/TLS connection to the source or target database is not possible. - `--table-handling` specifies that existing tables on the target CockroachDB database should not be modified before the source data is loaded. - `--direct-copy` specifies that `COPY FROM` is used to load the tables directly, without creating intermediate files. +- `--allow-tls-mode-disable` enables insecure connections to the source and target databases. Refer to [Secure connections](#secure-connections). ### Continue fetch after encountering an error -If `molt fetch` encounters an error, it exits with an error message, fetch ID, and continuation token for each table that failed to load on the target database. You can use these values to [continue the fetch process](#fetch-continuation) from where it was interrupted. +If the fetch process encounters an error, it exits with an error message, fetch ID, and continuation token for each table that failed to load on the target database. You can use these values to [continue the fetch process](#fetch-continuation) from where it was interrupted. ~~~ json {"level":"info","table":"public.tbl1","file_name":"shard_01_part_00000001.csv","message":"creating or updating token for duplicate key value violates unique constraint \"tbl1_pkey\"; Key (id)=(22) already exists."} @@ -416,6 +716,10 @@ If `molt fetch` encounters an error, it exits with an error message, fetch ID, a To retry a specific table, reissue the initial `molt fetch` command and include the fetch ID and a continuation token: +{{site.data.alerts.callout_success}} +You can use `molt fetch tokens list` to list all active continuation tokens. Refer to [List active continuation tokens](#list-active-continuation-tokens). +{{site.data.alerts.end}} + {% include_cached copy-clipboard.html %} ~~~ shell molt fetch \ @@ -424,7 +728,15 @@ molt fetch \ --continuation-token '5e7c7173-101c-4539-9b8d-28fad37d0240' ~~~ -To retry all tables that failed, exclude `--continuation-token` from the command. +To retry all tables that failed, exclude `--continuation-token` from the command. When prompted, type `y` to clear all active continuation tokens. To avoid the prompt (e.g., when running `molt fetch` in a job), include the `--non-interactive` flag: + +{% include_cached copy-clipboard.html %} +~~~ shell +molt fetch \ +... \ +--fetch-id '87bf8dc0-803c-4e26-89d5-3352576f92a7' \ +--non-interactive +~~~ ## See also diff --git a/src/current/v23.2/molt-verify.md b/src/current/v23.2/molt-verify.md index 561141a9369..1b239439615 100644 --- a/src/current/v23.2/molt-verify.md +++ b/src/current/v23.2/molt-verify.md @@ -39,7 +39,7 @@ To install MOLT Verify, download the binary that matches your system. To downloa | Linux | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-arm64.tgz) | | Mac | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-arm64.tgz) | -For previous binaries, see the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). For releases v0.0.6 and earlier, see the [MOLT repository](https://github.com/cockroachdb/molt/releases). +For previous binaries, refer to the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). # Setup diff --git a/src/current/v23.2/restore.md b/src/current/v23.2/restore.md index 1d2b99d7868..840886cb548 100644 --- a/src/current/v23.2/restore.md +++ b/src/current/v23.2/restore.md @@ -117,20 +117,21 @@ You can control `RESTORE` behavior using any of the following in the `restore_op Option |
Value
| Description -------------------------------------------------------------------+---------------+------------------------------------------------------- +`debug_pause_on` | `"error" ` | Use to have a `RESTORE` [job]({% link {{ page.version.version }}/show-jobs.md %}) self pause when it encounters an error. The `RESTORE` job can then be [resumed]({% link {{ page.version.version }}/resume-job.md %}) after the error has been fixed or [canceled]({% link {{ page.version.version }}/cancel-job.md %}) to rollback the job.

Example: `WITH debug_pause_on='error'` +`DETACHED` | N/A | When `RESTORE` runs with `DETACHED`, the job will execute asynchronously. The job ID is returned after the restore job creation completes. Note that with `DETACHED` specified, further job information and the job completion status will not be returned. For more on the differences between the returned job data, see the [example]({% link {{ page.version.version }}/restore.md %}#restore-a-backup-asynchronously) below. To check on the job status, use the [`SHOW JOBS`]({% link {{ page.version.version }}/show-jobs.md %}) statement.

To run a restore within a [transaction]({% link {{ page.version.version }}/transactions.md %}), use the `DETACHED` option. +`encryption_passphrase` | Passphrase used to create the [encrypted backup]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) | The passphrase used to decrypt the file(s) that were encrypted by the [`BACKUP`]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) statement. +New in v23.2:`EXECUTION LOCALITY` | Key-value pairs | Restricts the execution of the restore to nodes that match the defined [locality filter]({% link {{ page.version.version }}/take-locality-restricted-backups.md %}) requirements.

Example: `WITH EXECUTION LOCALITY = 'region=us-west-1a,cloud=aws'` +`incremental_location` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | Restore an incremental backup from the alternate collection URI the backup was originally taken with.

See [Restore incremental backups](#restore-a-specific-full-or-incremental-backup) for more detail. `into_db` | Database name | Use to [change the target database](#restore-tables-into-a-different-database) for table restores. The target database must exist before a restore with `into_db`. (Does not apply to database or cluster restores.)

Example: `WITH into_db = 'newdb'` +`kms` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | The URI of the cryptographic key stored in a key management service (KMS), or a comma-separated list of key URIs, used to [take and restore encrypted backups]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#examples). Refer to [URI Formats]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#uri-formats) on the Encrypted Backups page. The key or keys are used to encrypt the manifest and data files that the `BACKUP` statement generates, decrypt them during a [restore]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#examples) operation, and list the contents of the backup when using [`SHOW BACKUP`]({% link {{ page.version.version }}/show-backup.md %}).

AWS KMS, Google Cloud KMS, and Azure Key Vault are supported. `new_db_name` | Database name | [Rename a database during a restore](#rename-a-database-on-restore). The existing backed-up database can remain active while the same database is restored with a different name.

Example: `RESTORE DATABASE movr ... WITH new_db_name = 'new_movr'` +`schema_only` | N/A | Verify that a backup is valid by running `RESTORE ... schema_only`, which will restore the backed-up schema without any user data. Refer to [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-a-backup-is-restorable) for detail and an example. +`skip_localities_check` | N/A | Use to skip checking localities of a cluster before a restore when there are mismatched [cluster regions]({% link {{ page.version.version }}/multiregion-overview.md %}#cluster-regions) between the backup's cluster and the target cluster.

Example: `WITH skip_localities_check` `skip_missing_foreign_keys` | N/A | Use to remove the missing [foreign key]({% link {{ page.version.version }}/foreign-key.md %}) constraints before restoring.

Example: `WITH skip_missing_foreign_keys` `skip_missing_sequences` | N/A | Use to ignore [sequence]({% link {{ page.version.version }}/show-sequences.md %}) dependencies (i.e., the `DEFAULT` expression that uses the sequence).

Example: `WITH skip_missing_sequences` `skip_missing_sequence_owners` | N/A | Must be used when restoring either a table that was previously a [sequence owner]({% link {{ page.version.version }}/create-sequence.md %}#owned-by) or a sequence that was previously owned by a table.

Example: `WITH skip_missing_sequence_owners` -`skip_missing_views` | N/A | Use to skip restoring [views]({% link {{ page.version.version }}/views.md %}) that cannot be restored because their dependencies are not being restored at the same time.

Example: `WITH skip_missing_views` -`skip_localities_check` | N/A | Use to skip checking localities of a cluster before a restore when there are mismatched [cluster regions]({% link {{ page.version.version }}/multiregion-overview.md %}#cluster-regions) between the backup's cluster and the target cluster.

Example: `WITH skip_localities_check` `skip_missing_udfs` | N/A | Must be used when restoring a table with referenced [UDF]({% link {{ page.version.version }}/user-defined-functions.md %}) dependencies. Any column's `DEFAULT` expression using UDFs is dropped.

Example: `WITH skip_missing_udfs` -`encryption_passphrase` | Passphrase used to create the [encrypted backup]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) | The passphrase used to decrypt the file(s) that were encrypted by the [`BACKUP`]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) statement. -`DETACHED` | N/A | When `RESTORE` runs with `DETACHED`, the job will execute asynchronously. The job ID is returned after the restore job creation completes. Note that with `DETACHED` specified, further job information and the job completion status will not be returned. For more on the differences between the returned job data, see the [example]({% link {{ page.version.version }}/restore.md %}#restore-a-backup-asynchronously) below. To check on the job status, use the [`SHOW JOBS`]({% link {{ page.version.version }}/show-jobs.md %}) statement.

To run a restore within a [transaction]({% link {{ page.version.version }}/transactions.md %}), use the `DETACHED` option. -New in v23.2:`EXECUTION LOCALITY` | Key-value pairs | Restricts the execution of the restore to nodes that match the defined [locality filter]({% link {{ page.version.version }}/take-locality-restricted-backups.md %}) requirements.

Example: `WITH EXECUTION LOCALITY = 'region=us-west-1a,cloud=aws'` -`debug_pause_on` | `"error" ` | Use to have a `RESTORE` [job]({% link {{ page.version.version }}/show-jobs.md %}) self pause when it encounters an error. The `RESTORE` job can then be [resumed]({% link {{ page.version.version }}/resume-job.md %}) after the error has been fixed or [canceled]({% link {{ page.version.version }}/cancel-job.md %}) to rollback the job.

Example: `WITH debug_pause_on='error'` -`incremental_location` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | Restore an incremental backup from the alternate collection URI the backup was originally taken with.

See [Restore incremental backups](#restore-a-specific-full-or-incremental-backup) for more detail. -`schema_only` | N/A | Verify that a backup is valid by running `RESTORE ... schema_only`, which will restore the backed-up schema without any user data. Refer to [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-a-backup-is-restorable) for detail and an example. +`skip_missing_views` | N/A | Use to skip restoring [views]({% link {{ page.version.version }}/views.md %}) that cannot be restored because their dependencies are not being restored at the same time.

Example: `WITH skip_missing_views` `verify_backup_table_data` | N/A | Run a `schema_only` restore **and** have the restore read all user data from external storage, verify checksums, and discard the user data before writing it to disk. You must also include the `schema_only` option in the `RESTORE` statement with `verify_backup_table_data`. For more detail, see [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-backup-table-data-is-restorable). ### Backup file URLs diff --git a/src/current/v23.2/security-reference/security-overview.md b/src/current/v23.2/security-reference/security-overview.md index 202f7a6a5e4..98fb7e3ad06 100644 --- a/src/current/v23.2/security-reference/security-overview.md +++ b/src/current/v23.2/security-reference/security-overview.md @@ -165,11 +165,11 @@ CockroachDB {{ site.data.products.core }} here refers to the situation of a user Network-level Configuration of allowed IP addresses -   + ✓1 ✓ ✓ ✓ - VPC Peering for GCP clusters and AWS PrivateLink for AWS clusters + Private Service Connect (PSC) (Preview) or VPC Peering for GCP clusters and AWS PrivateLink for AWS clusters Non-Repudiation @@ -188,3 +188,5 @@ CockroachDB {{ site.data.products.core }} here refers to the situation of a user CockroachDB, as a distributed SQL database, is uniquely resilient by nature. A cluster can tolerate node failures as long as the majority of nodes remain functional. See Disaster Recovery. + +1: AWS PrivateLink is in preview for multi-region Serverless clusters, and is not supported for single-region Serverless clusters. Refer to Manage AWS PrivateLink. diff --git a/src/current/v24.1/changefeed-examples.md b/src/current/v24.1/changefeed-examples.md index 5a6a600e54f..2b4f83f325a 100644 --- a/src/current/v24.1/changefeed-examples.md +++ b/src/current/v24.1/changefeed-examples.md @@ -459,35 +459,32 @@ You'll need access to a [Google Cloud Project](https://cloud.google.com/resource NOTICE: changefeed will emit to topic movr-users ~~~ - To view all the messages delivered to your topic, you can use the Cloud Console. You'll see the messages emitted to the `movr-users-sub` subscription. + To view all the messages delivered to your topic, you can use: + - The Google Cloud Console. From the Pub/Sub menu, select **Subscriptions** in the left-hand navigation and then select the subscription ID from your list of subscriptions. On the subscription's overview, click **Messages**, and then **Pull** to view messages. + - The `gcloud` CLI. From your terminal, run the following command: - Google Cloud Console changefeed message output from movr database - - To view published messages from your terminal, run the following command: - - {% include_cached copy-clipboard.html %} - ~~~ shell - gcloud pubsub subscriptions pull movr-users-sub --auto-ack --limit=10 - ~~~ + {% include_cached copy-clipboard.html %} + ~~~ shell + gcloud pubsub subscriptions pull movr-users-sub --auto-ack --limit=10 + ~~~ - This command will **only** pull these messages once per subscription. For example, if you ran this command again you would receive 10 different messages in your output. To receive more than one message at a time, pass the `--limit` flag. For more details, see the [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull) documentation. + This command will **only** pull these messages once per subscription. For example, if you ran this command again you would receive 10 different messages in your output. To receive more than one message at a time, pass the `--limit` flag. For more details, refer to the [gcloud pubsub subscriptions pull](https://cloud.google.com/sdk/gcloud/reference/pubsub/subscriptions/pull) documentation. - ~~~ - ┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ - │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ - ├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────────────────────────────────────────────┼────────────┼──────────────────┤ - │ {"key":["boston","40ef7cfa-5e16-4bd3-9e14-2f23407a66df"],"value":{"after":{"address":"14980 Gentry Plains Apt. 64","city":"boston","credit_card":"2466765790","id":"40ef7cfa-5e16-4bd3-9e14-2f23407a66df","name":"Vickie Fitzpatrick"}},"topic":"movr-users"} │ 4466153049158588 │ ["boston", "40ef7cfa-5e16-4bd3-9e14-2f23407a66df"] │ │ │ - │ {"key":["los angeles","947ae147-ae14-4800-8000-00000000001d"],"value":{"after":{"address":"35627 Chelsey Tunnel Suite 94","city":"los angeles","credit_card":"2099932769","id":"947ae147-ae14-4800-8000-00000000001d","name":"Kenneth Barnes"}},"topic":"movr-users"} │ 4466144577818136 │ ["los angeles", "947ae147-ae14-4800-8000-00000000001d"] │ │ │ - │ {"key":["amsterdam","c28f5c28-f5c2-4000-8000-000000000026"],"value":{"after":{"address":"14729 Karen Radial","city":"amsterdam","credit_card":"5844236997","id":"c28f5c28-f5c2-4000-8000-000000000026","name":"Maria Weber"}},"topic":"movr-users"} │ 4466151194002912 │ ["amsterdam", "c28f5c28-f5c2-4000-8000-000000000026"] │ │ │ - │ {"key":["new york","6c8ab772-584a-439d-b7b4-fda37767c74c"],"value":{"after":{"address":"34196 Roger Row Suite 6","city":"new york","credit_card":"3117945420","id":"6c8ab772-584a-439d-b7b4-fda37767c74c","name":"James Lang"}},"topic":"movr-users"} │ 4466147099992681 │ ["new york", "6c8ab772-584a-439d-b7b4-fda37767c74c"] │ │ │ - │ {"key":["boston","c56dab0a-63e7-4fbb-a9af-54362c481c41"],"value":{"after":{"address":"83781 Ross Overpass","city":"boston","credit_card":"7044597874","id":"c56dab0a-63e7-4fbb-a9af-54362c481c41","name":"Mark Butler"}},"topic":"movr-users"} │ 4466150752442731 │ ["boston", "c56dab0a-63e7-4fbb-a9af-54362c481c41"] │ │ │ - │ {"key":["amsterdam","f27e09d5-d7cd-4f88-8b65-abb910036f45"],"value":{"after":{"address":"77153 Donald Road Apt. 62","city":"amsterdam","credit_card":"7531160744","id":"f27e09d5-d7cd-4f88-8b65-abb910036f45","name":"Lisa Sandoval"}},"topic":"movr-users"} │ 4466147182359256 │ ["amsterdam", "f27e09d5-d7cd-4f88-8b65-abb910036f45"] │ │ │ - │ {"key":["new york","46d200c0-6924-4cc7-b3c9-3398997acb84"],"value":{"after":{"address":"92843 Carlos Grove","city":"new york","credit_card":"8822366402","id":"46d200c0-6924-4cc7-b3c9-3398997acb84","name":"Mackenzie Malone"}},"topic":"movr-users"} │ 4466142864542016 │ ["new york", "46d200c0-6924-4cc7-b3c9-3398997acb84"] │ │ │ - │ {"key":["boston","52ecbb26-0eab-4e0b-a160-90caa6a7d350"],"value":{"after":{"address":"95044 Eric Corner Suite 33","city":"boston","credit_card":"3982363300","id":"52ecbb26-0eab-4e0b-a160-90caa6a7d350","name":"Brett Porter"}},"topic":"movr-users"} │ 4466152539161631 │ ["boston", "52ecbb26-0eab-4e0b-a160-90caa6a7d350"] │ │ │ - │ {"key":["amsterdam","ae147ae1-47ae-4800-8000-000000000022"],"value":{"after":{"address":"88194 Angela Gardens Suite 94","city":"amsterdam","credit_card":"4443538758","id":"ae147ae1-47ae-4800-8000-000000000022","name":"Tyler Dalton"}},"topic":"movr-users"} │ 4466151398997150 │ ["amsterdam", "ae147ae1-47ae-4800-8000-000000000022"] │ │ │ - │ {"key":["paris","dc28f5c2-8f5c-4800-8000-00000000002b"],"value":{"after":{"address":"2058 Rodriguez Stream","city":"paris","credit_card":"9584502537","id":"dc28f5c2-8f5c-4800-8000-00000000002b","name":"Tony Ortiz"}},"topic":"movr-users"} │ 4466146372222914 │ ["paris", "dc28f5c2-8f5c-4800-8000-00000000002b"] │ │ │ - └──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────────────────────────────────────────────┴────────────┴──────────────────┘ - ~~~ + ~~~ + ┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬──────────────┬────────────┬──────────────────┬────────────┐ + │ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ ACK_STATUS │ + ├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼──────────────┼────────────┼──────────────────┼────────────┤ + │ {"Key":["amsterdam", "09ee2856-5856-40c4-85d3-7d65bed978f0"],"Value":{"after": {"address": "84579 Peter Divide Apt. 47", "city": "amsterdam", "credit_card": "0100007510", "id": "09ee2856-5856-40c4-85d3-7d65bed978f0", "name": "Timothy Jackson"}},"Topic":"movr-users"} │ 11249015757941393 │ │ │ │ SUCCESS │ + │ {"Key":["new york", "8803ab9e-5001-4994-a2e6-68d587f95f1d"],"Value":{"after": {"address": "37546 Andrew Roads Apt. 68", "city": "new york", "credit_card": "4731676650", "id": "8803ab9e-5001-4994-a2e6-68d587f95f1d", "name": "Susan Harrington"}},"Topic":"movr-users"} │ 11249015757941394 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "32e27201-ca0d-4a0c-ada2-fbf47f6a4711"],"Value":{"after": {"address": "86725 Stephen Gardens", "city": "seattle", "credit_card": "3639690115", "id": "32e27201-ca0d-4a0c-ada2-fbf47f6a4711", "name": "Brad Hill"}},"Topic":"movr-users"} │ 11249015757941395 │ │ │ │ SUCCESS │ + │ {"Key":["san francisco", "27b03637-ef9f-49a0-9b58-b16d7a9e34f4"],"Value":{"after": {"address": "85467 Tiffany Field", "city": "san francisco", "credit_card": "0016125921", "id": "27b03637-ef9f-49a0-9b58-b16d7a9e34f4", "name": "Mark Garcia"}},"Topic":"movr-users"} │ 11249015757941396 │ │ │ │ SUCCESS │ + │ {"Key":["rome", "982e1863-88d4-49cb-adee-0a35baae7e0b"],"Value":{"after": {"address": "54918 Sutton Isle Suite 74", "city": "rome", "credit_card": "6015706174", "id": "982e1863-88d4-49cb-adee-0a35baae7e0b", "name": "Kimberly Nichols"}},"Topic":"movr-users"} │ 11249015757941397 │ │ │ │ SUCCESS │ + │ {"Key":["washington dc", "7b298994-7b12-414c-90ef-353c7105f012"],"Value":{"after": {"address": "45205 Romero Ford Apt. 86", "city": "washington dc", "credit_card": "3519400314", "id": "7b298994-7b12-414c-90ef-353c7105f012", "name": "Taylor Bullock"}},"Topic":"movr-users"} │ 11249015757941398 │ │ │ │ SUCCESS │ + │ {"Key":["boston", "4f012f57-577b-4853-b5ab-0d79d0df1369"],"Value":{"after": {"address": "15765 Vang Ramp", "city": "boston", "credit_card": "6747715133", "id": "4f012f57-577b-4853-b5ab-0d79d0df1369", "name": "Ryan Garcia"}},"Topic":"movr-users"} │ 11249015757941399 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "9ba85917-5545-4674-8ab2-497fa47ac00f"],"Value":{"after": {"address": "24354 Whitney Lodge", "city": "seattle", "credit_card": "8642661685", "id": "9ba85917-5545-4674-8ab2-497fa47ac00f", "name": "Donald Walsh"}},"Topic":"movr-users"} │ 11249015757941400 │ │ │ │ SUCCESS │ + │ {"Key":["seattle", "98312fb3-230e-412d-9b22-074ec97329ff"],"Value":{"after": {"address": "72777 Carol Shoal", "city": "seattle", "credit_card": "7789799678", "id": "98312fb3-230e-412d-9b22-074ec97329ff", "name": "Christopher Davis"}},"Topic":"movr-users"} │ 11249015757941401 │ │ │ │ SUCCESS │ + └─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴──────────────┴────────────┴──────────────────┴────────────┘ + ~~~ ## Create a changefeed connected to a cloud storage sink diff --git a/src/current/v24.1/changefeed-sinks.md b/src/current/v24.1/changefeed-sinks.md index 7b771659dbd..0df4882978c 100644 --- a/src/current/v24.1/changefeed-sinks.md +++ b/src/current/v24.1/changefeed-sinks.md @@ -239,6 +239,10 @@ The following parameters are also needed, but are **set by default** in Cockroac Changefeeds can deliver messages to a Google Cloud Pub/Sub sink, which is integrated with Google Cloud Platform. +{{site.data.alerts.callout_info}} +Since CockroachDB v23.2, the `changefeed.new_pubsub_sink_enabled` cluster setting is enabled by default, which provides improved throughput. Without this cluster setting enabled, changefeeds emit JSON-encoded events with the top-level message fields all lowercase. With `changefeed.new_pubsub_sink_enabled`, the top-level fields are capitalized. For more details, refer to the [Pub/Sub sink messages](#pub-sub-sink-messages) section. +{{site.data.alerts.end}} + A Pub/Sub sink URI follows this example: ~~~ @@ -313,23 +317,40 @@ pubsub_sink_config = '{ "Flush": {"Messages": 100, "Frequency": "5s"}, "Retry": ### Pub/Sub sink messages +The `changefeed.new_pubsub_sink_enabled` cluster setting is enabled by default, which provides improved changefeed throughput peformance. With `changefeed.new_pubsub_sink_enabled` enabled, the changefeed JSON-encoded message format have top-level fields that are capitalized: + +~~~ +{Key: ..., Value: ..., Topic: ...} +~~~ + +{{site.data.alerts.callout_danger}} +By default in v23.2, the capitalization of top-level fields in the message has changed. Before upgrading to CockroachDB v23.2 and later, you may need to reconfigure downstream systems to parse the new message format. +{{site.data.alerts.end}} + +With `changefeed.new_pubsub_sink_enabled` set to `false`, changefeeds emit JSON messages with the top-level fields all lowercase: + +~~~ +{key: ..., value: ..., topic: ...} +~~~ + +If `changefeed.new_pubsub_sink_enabled` is set to `false`, changefeeds will not benefit from the improved throughput performance that this setting enables. + The following shows the default JSON messages for a changefeed emitting to Pub/Sub. These changefeed messages were emitted as part of the [Create a changefeed connected to a Google Cloud Pub/Sub sink]({% link {{ page.version.version }}/changefeed-examples.md %}#create-a-changefeed-connected-to-a-google-cloud-pub-sub-sink) example: ~~~ -┌──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────────────────────────────────────────────┬────────────┬──────────────────┐ -│ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ -├──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────────────────────────────────────────────┼────────────┼──────────────────┤ -│ {"key":["boston","40ef7cfa-5e16-4bd3-9e14-2f23407a66df"],"value":{"after":{"address":"14980 Gentry Plains Apt. 64","city":"boston","credit_card":"2466765790","id":"40ef7cfa-5e16-4bd3-9e14-2f23407a66df","name":"Vickie Fitzpatrick"}},"topic":"movr-users"} │ 4466153049158588 │ ["boston", "40ef7cfa-5e16-4bd3-9e14-2f23407a66df"] │ │ │ -│ {"key":["los angeles","947ae147-ae14-4800-8000-00000000001d"],"value":{"after":{"address":"35627 Chelsey Tunnel Suite 94","city":"los angeles","credit_card":"2099932769","id":"947ae147-ae14-4800-8000-00000000001d","name":"Kenneth Barnes"}},"topic":"movr-users"} │ 4466144577818136 │ ["los angeles", "947ae147-ae14-4800-8000-00000000001d"] │ │ │ -│ {"key":["amsterdam","c28f5c28-f5c2-4000-8000-000000000026"],"value":{"after":{"address":"14729 Karen Radial","city":"amsterdam","credit_card":"5844236997","id":"c28f5c28-f5c2-4000-8000-000000000026","name":"Maria Weber"}},"topic":"movr-users"} │ 4466151194002912 │ ["amsterdam", "c28f5c28-f5c2-4000-8000-000000000026"] │ │ │ -│ {"key":["new york","6c8ab772-584a-439d-b7b4-fda37767c74c"],"value":{"after":{"address":"34196 Roger Row Suite 6","city":"new york","credit_card":"3117945420","id":"6c8ab772-584a-439d-b7b4-fda37767c74c","name":"James Lang"}},"topic":"movr-users"} │ 4466147099992681 │ ["new york", "6c8ab772-584a-439d-b7b4-fda37767c74c"] │ │ │ -│ {"key":["boston","c56dab0a-63e7-4fbb-a9af-54362c481c41"],"value":{"after":{"address":"83781 Ross Overpass","city":"boston","credit_card":"7044597874","id":"c56dab0a-63e7-4fbb-a9af-54362c481c41","name":"Mark Butler"}},"topic":"movr-users"} │ 4466150752442731 │ ["boston", "c56dab0a-63e7-4fbb-a9af-54362c481c41"] │ │ │ -│ {"key":["amsterdam","f27e09d5-d7cd-4f88-8b65-abb910036f45"],"value":{"after":{"address":"77153 Donald Road Apt. 62","city":"amsterdam","credit_card":"7531160744","id":"f27e09d5-d7cd-4f88-8b65-abb910036f45","name":"Lisa Sandoval"}},"topic":"movr-users"} │ 4466147182359256 │ ["amsterdam", "f27e09d5-d7cd-4f88-8b65-abb910036f45"] │ │ │ -│ {"key":["new york","46d200c0-6924-4cc7-b3c9-3398997acb84"],"value":{"after":{"address":"92843 Carlos Grove","city":"new york","credit_card":"8822366402","id":"46d200c0-6924-4cc7-b3c9-3398997acb84","name":"Mackenzie Malone"}},"topic":"movr-users"} │ 4466142864542016 │ ["new york", "46d200c0-6924-4cc7-b3c9-3398997acb84"] │ │ │ -│ {"key":["boston","52ecbb26-0eab-4e0b-a160-90caa6a7d350"],"value":{"after":{"address":"95044 Eric Corner Suite 33","city":"boston","credit_card":"3982363300","id":"52ecbb26-0eab-4e0b-a160-90caa6a7d350","name":"Brett Porter"}},"topic":"movr-users"} │ 4466152539161631 │ ["boston", "52ecbb26-0eab-4e0b-a160-90caa6a7d350"] │ │ │ -│ {"key":["amsterdam","ae147ae1-47ae-4800-8000-000000000022"],"value":{"after":{"address":"88194 Angela Gardens Suite 94","city":"amsterdam","credit_card":"4443538758","id":"ae147ae1-47ae-4800-8000-000000000022","name":"Tyler Dalton"}},"topic":"movr-users"} │ 4466151398997150 │ ["amsterdam", "ae147ae1-47ae-4800-8000-000000000022"] │ │ │ -│ {"key":["paris","dc28f5c2-8f5c-4800-8000-00000000002b"],"value":{"after":{"address":"2058 Rodriguez Stream","city":"paris","credit_card":"9584502537","id":"dc28f5c2-8f5c-4800-8000-00000000002b","name":"Tony Ortiz"}},"topic":"movr-users"} │ 4466146372222914 │ ["paris", "dc28f5c2-8f5c-4800-8000-00000000002b"] │ │ │ -└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────────────────────────────────────────────┴────────────┴──────────────────┘ +┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬───────────────────┬──────────────┬────────────┬──────────────────┬────────────┐ +│ DATA │ MESSAGE_ID │ ORDERING_KEY │ ATTRIBUTES │ DELIVERY_ATTEMPT │ ACK_STATUS │ +├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼───────────────────┼──────────────┼────────────┼──────────────────┼────────────┤ +│ {"Key":["amsterdam", "09ee2856-5856-40c4-85d3-7d65bed978f0"],"Value":{"after": {"address": "84579 Peter Divide Apt. 47", "city": "amsterdam", "credit_card": "0100007510", "id": "09ee2856-5856-40c4-85d3-7d65bed978f0", "name": "Timothy Jackson"}},"Topic":"users"} │ 11249015757941393 │ │ │ │ SUCCESS │ +│ {"Key":["new york", "8803ab9e-5001-4994-a2e6-68d587f95f1d"],"Value":{"after": {"address": "37546 Andrew Roads Apt. 68", "city": "new york", "credit_card": "4731676650", "id": "8803ab9e-5001-4994-a2e6-68d587f95f1d", "name": "Susan Harrington"}},"Topic":"users"} │ 11249015757941394 │ │ │ │ SUCCESS │ +│ {"Key":["seattle", "32e27201-ca0d-4a0c-ada2-fbf47f6a4711"],"Value":{"after": {"address": "86725 Stephen Gardens", "city": "seattle", "credit_card": "3639690115", "id": "32e27201-ca0d-4a0c-ada2-fbf47f6a4711", "name": "Brad Hill"}},"Topic":"users"} │ 11249015757941395 │ │ │ │ SUCCESS │ +│ {"Key":["san francisco", "27b03637-ef9f-49a0-9b58-b16d7a9e34f4"],"Value":{"after": {"address": "85467 Tiffany Field", "city": "san francisco", "credit_card": "0016125921", "id": "27b03637-ef9f-49a0-9b58-b16d7a9e34f4", "name": "Mark Garcia"}},"Topic":"users"} │ 11249015757941396 │ │ │ │ SUCCESS │ +│ {"Key":["rome", "982e1863-88d4-49cb-adee-0a35baae7e0b"],"Value":{"after": {"address": "54918 Sutton Isle Suite 74", "city": "rome", "credit_card": "6015706174", "id": "982e1863-88d4-49cb-adee-0a35baae7e0b", "name": "Kimberly Nichols"}},"Topic":"users"} │ 11249015757941397 │ │ │ │ SUCCESS │ +│ {"Key":["washington dc", "7b298994-7b12-414c-90ef-353c7105f012"],"Value":{"after": {"address": "45205 Romero Ford Apt. 86", "city": "washington dc", "credit_card": "3519400314", "id": "7b298994-7b12-414c-90ef-353c7105f012", "name": "Taylor Bullock"}},"Topic":"users"} │ 11249015757941398 │ │ │ │ SUCCESS │ +│ {"Key":["boston", "4f012f57-577b-4853-b5ab-0d79d0df1369"],"Value":{"after": {"address": "15765 Vang Ramp", "city": "boston", "credit_card": "6747715133", "id": "4f012f57-577b-4853-b5ab-0d79d0df1369", "name": "Ryan Garcia"}},"Topic":"users"} │ 11249015757941399 │ │ │ │ SUCCESS │ +│ {"Key":["seattle", "9ba85917-5545-4674-8ab2-497fa47ac00f"],"Value":{"after": {"address": "24354 Whitney Lodge", "city": "seattle", "credit_card": "8642661685", "id": "9ba85917-5545-4674-8ab2-497fa47ac00f", "name": "Donald Walsh"}},"Topic":"users"} │ 11249015757941400 │ │ │ │ SUCCESS │ +│ {"Key":["seattle", "98312fb3-230e-412d-9b22-074ec97329ff"],"Value":{"after": {"address": "72777 Carol Shoal", "city": "seattle", "credit_card": "7789799678", "id": "98312fb3-230e-412d-9b22-074ec97329ff", "name": "Christopher Davis"}},"Topic":"users"} │ 11249015757941401 │ │ │ │ SUCCESS │ +└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴──────────────┴────────────┴──────────────────┴────────────┘ ~~~ {% include {{ page.version.version }}/cdc/note-changefeed-message-page.md %} diff --git a/src/current/v24.1/create-changefeed.md b/src/current/v24.1/create-changefeed.md index 6a084278824..0ec6017731a 100644 --- a/src/current/v24.1/create-changefeed.md +++ b/src/current/v24.1/create-changefeed.md @@ -102,6 +102,8 @@ Example of a Google Cloud Pub/Sub sink URI: 'gcpubsub://{project name}?region={region}&topic_name={topic name}&AUTH=specified&CREDENTIALS={base64-encoded key}' ~~~ +In CockroachDB v23.2 and later, the `changefeed.new_pubsub_sink_enabled` cluster setting is enabled by default, which provides improved throughput. For details on the changes to the message format, refer to [Pub/Sub sink messages]({% link {{ page.version.version }}/changefeed-sinks.md %}#pub-sub-sink-messages). + [Use Cloud Storage for Bulk Operations]({% link {{ page.version.version }}/cloud-storage-authentication.md %}) explains the requirements for the authentication parameter with `specified` or `implicit`. Refer to [Changefeed Sinks]({% link {{ page.version.version }}/changefeed-sinks.md %}#google-cloud-pub-sub) for further consideration. #### Kafka diff --git a/src/current/v24.1/cutover-replication.md b/src/current/v24.1/cutover-replication.md index 731a020b99f..ec0cb7e14c4 100644 --- a/src/current/v24.1/cutover-replication.md +++ b/src/current/v24.1/cutover-replication.md @@ -5,10 +5,6 @@ toc: true docs_area: manage --- -{{site.data.alerts.callout_info}} -{% include feature-phases/preview.md %} -{{site.data.alerts.end}} - [**Physical cluster replication (PCR)**]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}) allows you to cut over from the active primary cluster to the passive standby cluster that has ingested replicated data. When you complete the replication, it will stop the stream of new data, reset the standby virtual cluster to a point in time where all ingested data is consistent, and then mark the standby virtual cluster as ready to accept traffic. The cutover is a two-step process on the standby cluster: @@ -54,6 +50,10 @@ SHOW VIRTUAL CLUSTER main WITH REPLICATION STATUS; (1 row) ~~~ +{{site.data.alerts.callout_success}} +You can view the [**Replication Lag** graph]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}#replication-lag) in the standby cluster's DB Console. +{{site.data.alerts.end}} + Run the following from the standby cluster's SQL shell to start the cutover: {% include_cached copy-clipboard.html %} @@ -304,13 +304,7 @@ This section illustrates the steps to cut back to the original primary cluster f SET CLUSTER SETTING server.controller.default_target_cluster='{cluster_a}'; ~~~ -<<<<<<< HEAD -At this point, **Cluster A** is once again the primary and **Cluster B** is once again the standby. The clusters are entirely independent. To direct application traffic to the primary (**Cluster A**), you will need to use your own network load balancers, DNS servers, or other network configuration to direct application traffic to **Cluster A**. To manage replicated jobs on the promoted standby, refer to [Job management](#job-management). - -To enable physical cluster replication again, from the primary to the standby (or a completely different cluster), refer to [Set Up Physical Cluster Replication]({% link {{ page.version.version }}/set-up-physical-cluster-replication.md %}). -======= At this point, **Cluster A** is once again the primary and **Cluster B** is once again the standby. The clusters are entirely independent. To direct application traffic to the primary (**Cluster A**), you will need to use your own network load balancers, DNS servers, or other network configuration to direct application traffic to **Cluster A**. To enable PCR again, from the primary to the standby (or a completely different cluster), refer to [Set Up Physical Cluster Replication]({% link {{ page.version.version }}/set-up-physical-cluster-replication.md %}). ->>>>>>> c9b9928e7 (Bring physical cluster replication into GA v24.1) ## See also diff --git a/src/current/v24.1/inverted-indexes.md b/src/current/v24.1/inverted-indexes.md index f65b54e1c10..6ca9524104b 100644 --- a/src/current/v24.1/inverted-indexes.md +++ b/src/current/v24.1/inverted-indexes.md @@ -97,7 +97,7 @@ If a query contains a filter against an indexed `JSONB` or `ARRAY` column that u In most cases CockroachDB selects the index it calculates will scan the fewest rows (i.e., the fastest). Cases where CockroachDB will use multiple indexes include certain queries that use disjunctions (i.e., predicates with `OR`), as well as [zigzag joins]({% link {{ page.version.version }}/cost-based-optimizer.md %}#zigzag-joins) for some other queries. To learn how to use the [`EXPLAIN`]({% link {{ page.version.version }}/explain.md %}) statement for your query to see which index is being used, see [Index Selection in CockroachDB](https://www.cockroachlabs.com/blog/index-selection-cockroachdb-2/). -To override CockroachDB's index selection, you can also force a query to use [a specific index]({% link {{ page.version.version }}/table-expressions.md %}#force-index-selection) (also known as "index hinting") or use [an inverted join hint]({% link {{ page.version.version }}/cost-based-optimizer.md %}#supported-join-algorithms). +To override CockroachDB's index selection, you can use an index hint to force a query to use [a specific index]({% link {{ page.version.version }}/table-expressions.md %}#force-index-selection), including [inverted indexes]({% link {{ page.version.version }}/table-expressions.md %}#force-inverted-index-scan) and [partial GIN indexes]({% link {{ page.version.version }}/table-expressions.md %}#force-partial-gin-index-scan); or use [an inverted join hint]({% link {{ page.version.version }}/cost-based-optimizer.md %}#supported-join-algorithms). ### Storage diff --git a/src/current/v24.1/known-limitations.md b/src/current/v24.1/known-limitations.md index 0b83770d0c3..2dae998ab10 100644 --- a/src/current/v24.1/known-limitations.md +++ b/src/current/v24.1/known-limitations.md @@ -2,7 +2,7 @@ title: Known Limitations in CockroachDB v24.1 summary: Learn about newly identified limitations in CockroachDB as well as unresolved limitations identified in earlier releases. toc: true -keywords: gin, gin index, gin indexes, inverted index, inverted indexes, accelerated index, accelerated indexes +keywords: limitations, known limitations, unsupported features, PostgreSQL compatibility docs_area: releases --- @@ -12,9 +12,24 @@ docs_area: releases This section describes newly identified limitations in CockroachDB {{ page.version.version }}. +{% comment %} {{site.data.alerts.callout_info}} Limitations will be added as they are discovered. {{site.data.alerts.end}} +{% endcomment %} + +### PL/pgSQL + +- It is not possible to use a variable as a target more than once in the same `INTO` clause. For example, `SELECT 1, 2 INTO x, x;`. [#121605](https://github.com/cockroachdb/cockroach/issues/121605) +- PLpgSQL variable declarations cannot inherit the type of a table row or column using `%TYPE` or `%ROWTYPE` syntax. [#114676](https://github.com/cockroachdb/cockroach/issues/114676) + +### UDFs and stored procedures + +- Routines cannot be invoked with named arguments, e.g., `SELECT foo(a => 1, b => 2);` or `SELECT foo(b := 1, a := 2);`. [#122264](https://github.com/cockroachdb/cockroach/issues/122264) +- Routines cannot be created if they reference temporary tables. [#121375](https://github.com/cockroachdb/cockroach/issues/121375) +- Routines cannot be created with unnamed `INOUT` parameters. For example, `CREATE PROCEDURE p(INOUT INT) AS $$ BEGIN NULL; END; $$ LANGUAGE PLpgSQL;`. [#121251](https://github.com/cockroachdb/cockroach/issues/121251) +- Routines cannot be created if they return fewer columns than declared. For example, `CREATE FUNCTION f(OUT sum INT, INOUT a INT, INOUT b INT) LANGUAGE SQL AS $$ SELECT (a + b, b); $$;`. [#121247](https://github.com/cockroachdb/cockroach/issues/121247) +- A `RECORD`-returning UDF cannot be created without a `RETURN` statement in the root block, which would restrict the wildcard type to a concrete one. [#122945](https://github.com/cockroachdb/cockroach/issues/122945) ## Limitations from {{ previous_version }} and earlier @@ -98,17 +113,15 @@ By default, CockroachDB orders `NULL`s before all other values. For compatibilit ### Functions and procedures -#### PL/pgSQL feature support - -{% include {{ page.version.version }}/known-limitations/plpgsql-feature-limitations.md %} - -#### PL/pgSQL data types +#### PL/pgSQL support -{% include {{ page.version.version }}/known-limitations/plpgsql-datatype-limitations.md %} +{% include {{ page.version.version }}/known-limitations/plpgsql-limitations.md %} #### UDF and stored procedure support -{% include {{ page.version.version }}/known-limitations/udf-stored-proc-limitations.md %} +{% include {{ page.version.version }}/known-limitations/routine-limitations.md %} +{% include {{ page.version.version }}/known-limitations/stored-proc-limitations.md %} +{% include {{ page.version.version }}/known-limitations/udf-limitations.md %} ### Transactions diff --git a/src/current/v24.1/licensing-faqs.md b/src/current/v24.1/licensing-faqs.md index 1b9bd2a5abd..ae21c3cc79c 100644 --- a/src/current/v24.1/licensing-faqs.md +++ b/src/current/v24.1/licensing-faqs.md @@ -36,6 +36,8 @@ For each BSL release all associated alpha, beta, major, and minor (point) releas CockroachDB version | License | Converts to Apache 2.0 --------------------|---------|---------------------------- +24.1 | Business Source License | May 20, 2027 +23.1 | Business Source License | Feb 5, 2027 23.1 | Business Source License | May 16, 2026 22.2 | Business Source License | Dec 6, 2025 22.1 | Business Source License | May 24, 2025 diff --git a/src/current/v24.1/live-migration-service.md b/src/current/v24.1/live-migration-service.md index c3b22310421..46befbfc939 100644 --- a/src/current/v24.1/live-migration-service.md +++ b/src/current/v24.1/live-migration-service.md @@ -9,7 +9,7 @@ docs_area: migrate {% include feature-phases/preview.md %} {{site.data.alerts.end}} -MOLT LMS (Live Migration Service) is used to perform a [live migration]({% link {{ page.version.version }}/migration-overview.md %}#minimal-downtime) to CockroachDB. +MOLT LMS (Live Migration Service) is used during a [live migration]({% link {{ page.version.version }}/migration-overview.md %}#minimal-downtime) to CockroachDB. The LMS is a self-hosted, horizontally scalable proxy that routes traffic between an application, a source database, and a target CockroachDB database. You use the LMS to control which database, as the "source of truth", is serving reads and writes to an application. You can optionally configure the LMS to [shadow production traffic](#shadowing-modes) from the source database and validate the query results on CockroachDB. When you have sufficiently tested your application and are confident with its consistency and performance on CockroachDB, you use the LMS to [perform the cutover](#perform-a-cutover) to CockroachDB. diff --git a/src/current/v24.1/migrate-from-mysql.md b/src/current/v24.1/migrate-from-mysql.md index 18150b7df1e..71485a01e5b 100644 --- a/src/current/v24.1/migrate-from-mysql.md +++ b/src/current/v24.1/migrate-from-mysql.md @@ -158,7 +158,7 @@ Use the [Schema Conversion Tool](https://www.cockroachlabs.com/docs/cockroachclo Click **Save**. - This is a workaround to prevent [data validation](#step-3-validate-the-migrated-data) from failing due to collation mismatches. For more details, see the [MOLT Verify] ({% link {{ page.version.version }}/molt-verify.md %}#limitations) documentation. + This is a workaround to prevent [data validation](#step-3-validate-the-migrated-data) from failing due to collation mismatches. For more details, see the [MOLT Verify] ({% link {{ page.version.version }}/molt-verify.md %}#known-limitations) documentation. 1. Click [**Migrate Schema**](https://www.cockroachlabs.com/docs/cockroachcloud/migrations-page?filters=mysql#migrate-the-schema) to create a new {{ site.data.products.serverless }} cluster with the converted schema. Name the database `world`. diff --git a/src/current/v24.1/migrate-from-oracle.md b/src/current/v24.1/migrate-from-oracle.md index fe0dc71455d..4d47ffebdac 100644 --- a/src/current/v24.1/migrate-from-oracle.md +++ b/src/current/v24.1/migrate-from-oracle.md @@ -6,7 +6,9 @@ docs_area: migrate --- {{site.data.alerts.callout_danger}} -The instructions on this page require updates. We currently recommend [using AWS Database Migration Service (DMS) to migrate data]({% link {{ page.version.version }}/aws-dms.md %}) from Oracle to CockroachDB. You can also [migrate from CSV]({% link {{ page.version.version }}/migrate-from-csv.md %}). +The instructions on this page are outdated. Use the [Schema Conversion Tool]({% link cockroachcloud/migrations-page.md %}?filters=oracle) to convert an Oracle schema into a compatible CockroachDB schema, and a tool such as [AWS Database Migration Service (DMS)]({% link {{ page.version.version }}/aws-dms.md %}) or [Qlik]({% link {{ page.version.version }}/qlik.md %}) to migrate data from Oracle to CockroachDB. + +Note that `IMPORT` is deprecated. To move data into CockroachDB, use [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}). {{site.data.alerts.end}} This page has instructions for migrating data from Oracle into CockroachDB by [importing]({% link {{ page.version.version }}/import.md %}) CSV files. Note that `IMPORT` only works for creating new tables. For information on how to add CSV data to existing tables, see [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}). diff --git a/src/current/v24.1/migration-overview.md b/src/current/v24.1/migration-overview.md index 3912952a489..3e1372af46a 100644 --- a/src/current/v24.1/migration-overview.md +++ b/src/current/v24.1/migration-overview.md @@ -62,17 +62,17 @@ A lift-and-shift approach is the most straightforward. However, it's important t - *Reduced functionality* takes some, but not all, application functionality offline. For example, you can disable writes but not reads while you migrate the application data, and queue data to be written after completing the migration. -For an overview of lift-and-shift migrations to CockroachDB, see [Lift and Shift](#lift-and-shift). For considerations and details about the pros and cons of this approach, see [Migration Strategy: Lift and Shift]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}). +For an overview of lift-and-shift migrations to CockroachDB, see [Lift and Shift](#lift-and-shift). #### Minimal downtime -If your application cannot tolerate downtime, then you should aim for a "zero-downtime" approach. "Zero" means that downtime is reduced to either an absolute minimum or zero, such that users do not notice the migration. +If your application cannot tolerate downtime, then you should aim for a "zero-downtime" approach. This reduces downtime to an absolute minimum, such that users do not notice the migration. The minimum possible downtime depends on whether you can tolerate inconsistency in the migrated data: -- *Consistent* migrations reduce downtime to an absolute minimum (i.e., from 30 seconds to sub-seconds) while keeping data synchronized between the source database and CockroachDB. **Consistency requires downtime.** In this approach, downtime occurs right before [cutover](#cutover-strategy), as you drain the remaining transactions from the source database to CockroachDB. +- Migrations performed using *consistent cutover* reduce downtime to an absolute minimum (i.e., seconds or sub-seconds) while keeping data synchronized between the source database and CockroachDB. **Consistency requires downtime.** In this approach, downtime occurs right before [cutover](#cutover-strategy), as you drain the remaining transactions from the source database to CockroachDB. -- *Inconsistent* migrations can reduce downtime to zero. These require the most preparation, and typically allow read/write traffic to both databases for at least a small amount of time, thereby sacrificing consistency for availability. {% comment %}You can use the CockroachDB Live Migration Service (MOLT LMS) to run application queries simultaneously on your source database and CockroachDB.{% endcomment %} Without stopping application traffic, you perform an immediate [cutover](#cutover-strategy), while assuming that some writes will not be replicated to CockroachDB. You may want to manually reconcile these data inconsistencies after switching over. +- Migrations performed using *immediate cutover* can reduce downtime to zero. These require the most preparation, and typically allow read/write traffic to both databases for at least a short period of time, sacrificing consistency for availability. {% comment %}You can use the CockroachDB Live Migration Service (MOLT LMS) to run application queries simultaneously on your source database and CockroachDB.{% endcomment %} Without stopping application traffic, you perform an **immediate** [cutover](#cutover-strategy), while assuming that some writes will not be replicated to CockroachDB. You may want to manually reconcile these data inconsistencies after switching over. For an overview of zero-downtime migrations to CockroachDB, see [Zero Downtime](#zero-downtime). {% comment %}For details, see [Migration Strategy: Zero Downtime](migration-strategy-zero-downtime).{% endcomment %} @@ -245,9 +245,11 @@ Then import the converted schema to a CockroachDB cluster: Before moving data, Cockroach Labs recommends [dropping any indexes]({% link {{ page.version.version }}/drop-index.md %}) on the CockroachDB database. The indexes can be [recreated]({% link {{ page.version.version }}/create-index.md %}) after the data is loaded. Doing so will optimize performance. {{site.data.alerts.end}} -After [converting the schema](#convert-the-schema), load your data into CockroachDB so that you can [test your application queries](#validate-queries). Then use one of the following methods to migrate the data (you may need to use additional tooling to extract and/or convert the data to an appropriate file format): +After [converting the schema](#convert-the-schema), load your data into CockroachDB so that you can [test your application queries](#validate-queries). Then use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. -- {% include {{ page.version.version }}/migration/load-data-import-into.md %} Typically, initial data loading during a database migration will not be running concurrently with application traffic, so the fact that `IMPORT INTO` takes the table offline may not have any observable availability impact. +Alternatively, you can use one of the following methods to migrate the data. Additional tooling may be required to extract or convert the data to a supported file format. + +- {% include {{ page.version.version }}/migration/load-data-import-into.md %} Typically during a migration, data is initially loaded before foreground application traffic begins to be served, so the impact of taking the table offline when running `IMPORT INTO` may be minimal. - {% include {{ page.version.version }}/migration/load-data-third-party.md %} Within the tool, you can select the database tables to migrate to the test cluster. - {% include {{ page.version.version }}/migration/load-data-copy-from.md %} @@ -259,9 +261,9 @@ Note that CockroachDB defaults to the [`SERIALIZABLE`]({% link {{ page.version.v ##### Shadowing -You can "shadow" your production workload by executing your source SQL statements on CockroachDB in parallel. The [CockroachDB Live Migration Service (LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) can perform shadowing. You can then [test the queries](#test-query-results-and-performance) on CockroachDB for consistency, performance, and potential issues with the migration. +You can "shadow" your production workload by executing your source SQL statements on CockroachDB in parallel. You can then [validate the queries](#test-query-results-and-performance) on CockroachDB for consistency, performance, and potential issues with the migration. -Shadowing may not be necessary or practical for your workload. For example, because transactions are serialized on CockroachDB, this will limit your ability to validate the performance of high-throughput workloads. +The [CockroachDB Live Migration Service (MOLT LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) can [perform shadowing]({% link {{ page.version.version }}/live-migration-service.md %}#shadowing-modes). This is intended only for [testing](#test-query-results-and-performance) or [performing a dry run](#perform-a-dry-run). Shadowing should **not** be used in production when performing a [live migration](#zero-downtime). ##### Test query results and performance @@ -310,35 +312,32 @@ Using this method, consistency is achieved by only performing the cutover once a The following is a high-level overview of the migration steps. For considerations and details about the pros and cons of this approach, see [Migration Strategy: Lift and Shift]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}). 1. Stop application traffic to your source database. **This begins downtime.** -1. Move data in one of the following ways: - - {% include {{ page.version.version }}/migration/load-data-import-into.md %} - - {% include {{ page.version.version }}/migration/load-data-third-party.md %} - - {% include {{ page.version.version }}/migration/load-data-copy-from.md %} -1. After the data is migrated, you can use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. +1. Use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. +1. After the data is migrated, use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. 1. Perform a [cutover](#cutover-strategy) by resuming application traffic, now to CockroachDB. {% comment %}1. If you want the ability to [roll back](#all-at-once-rollback) the migration, replicate data back to the source database.{% endcomment %} ### Zero Downtime -Using this method, downtime is minimized by performing the cutover while writes are still being replicated from the source database to CockroachDB. Inconsistencies are resolved through manual reconciliation. - -The following is a high-level overview of the migration steps. {% comment %}For details on this migration strategy, see [Migration Strategy: Zero Downtime]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}).{% endcomment %} +During a "live migration", downtime is minimized by performing the cutover while writes are still being replicated from the source database to CockroachDB. Inconsistencies are resolved through manual reconciliation. -{% comment %}You can use the CockroachDB Live Migration Service (MOLT LMS) to run application queries simultaneously on your source database and CockroachDB.{% endcomment %} +The following is a high-level overview of the migration steps. The two approaches are mutually exclusive, and each has [tradeoffs](#minimal-downtime). {% comment %}For details on this migration strategy, see [Migration Strategy: Zero Downtime]({% link {{ page.version.version }}/migration-strategy-lift-and-shift.md %}).{% endcomment %} To prioritize consistency and minimize downtime: -1. {% include {{ page.version.version }}/migration/load-data-third-party.md %} Select the tool's option to **replicate ongoing changes** after performing the initial load of data into CockroachDB. -1. As the data is migrating, you can use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. -1. Once nearly all data from your source database has been moved to CockroachDB (for example, with a <1 second delay or <1000 rows), stop application traffic to your source database. **This begins downtime.** -1. Wait for replication to CockroachDB to complete. -1. Perform a [cutover](#cutover-strategy) by resuming application traffic, now to CockroachDB. +1. Set up the [CockroachDB Live Migration Service (MOLT LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) to proxy for application traffic between your source database and CockroachDB. Do **not** shadow the application traffic. +1. Use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. Use the tool to [**replicate ongoing changes**]({% link {{ page.version.version }}/molt-fetch.md %}#replication) after it performs the initial load of data into CockroachDB. +1. As the data is migrating, use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. +1. After nearly all data from your source database has been moved to CockroachDB (for example, with a <1-second delay or <1000 rows), use MOLT LMS to begin a [*consistent cutover*]({% link {{ page.version.version }}/live-migration-service.md %}#consistent-cutover) and stop application traffic to your source database. **This begins downtime.** +1. Wait for MOLT Fetch to finish replicating changes to CockroachDB. +1. Use MOLT LMS to commit the [consistent cutover]({% link {{ page.version.version }}/live-migration-service.md %}#consistent-cutover). This resumes application traffic, now to CockroachDB. To achieve zero downtime with inconsistency: -1. {% include {{ page.version.version }}/migration/load-data-third-party.md %} Select the tool's option to replicate ongoing changes after performing the initial load of data into CockroachDB. +1. Set up the [CockroachDB Live Migration Service (MOLT LMS)]({% link {{ page.version.version }}/live-migration-service.md %}) to proxy for application traffic between your source database and CockroachDB. Use a [shadowing mode]({% link {{ page.version.version }}/live-migration-service.md %}#shadowing-modes) to run application queries simultaneously on your source database and CockroachDB. +1. Use [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) to move the source data to CockroachDB. Use the tool to **replicate ongoing changes** after performing the initial load of data into CockroachDB. 1. As the data is migrating, you can use [MOLT Verify]({% link {{ page.version.version }}/molt-verify.md %}) to validate the consistency of the data between the source database and CockroachDB. -1. Once nearly all data from your source database has been moved to CockroachDB (for example, with a <1 second delay or <1000 rows), perform a [cutover](#cutover-strategy) by pointing application traffic to CockroachDB. +1. After nearly all data from your source database has been moved to CockroachDB (for example, with a <1 second delay or <1000 rows), perform an [*immediate cutover*](#cutover-strategy) by pointing application traffic to CockroachDB. 1. Manually reconcile any inconsistencies caused by writes that were not replicated during the cutover. 1. Close the connection to the source database when you are ready to finish the migration. diff --git a/src/current/v24.1/molt-fetch.md b/src/current/v24.1/molt-fetch.md index 811262e216f..7d4098b7d23 100644 --- a/src/current/v24.1/molt-fetch.md +++ b/src/current/v24.1/molt-fetch.md @@ -5,13 +5,9 @@ toc: true docs_area: migrate --- -{{site.data.alerts.callout_info}} -{% include feature-phases/preview.md %} -{{site.data.alerts.end}} - MOLT Fetch moves data from a source database into CockroachDB as part of a [database migration]({% link {{ page.version.version }}/migration-overview.md %}). -MOLT Fetch can use `IMPORT INTO` or `COPY FROM` to move the source data to CockroachDB via cloud storage (Google Cloud Storage or Amazon S3), a local file server, or directly without an intermediate store. For details, see [Usage](#usage). +MOLT Fetch uses [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}) to move the source data to cloud storage (Google Cloud Storage or Amazon S3), a local file server, or local memory. Once the data is exported, MOLT Fetch loads the data onto a target CockroachDB database. For details, see [Usage](#usage). ## Supported databases @@ -31,21 +27,27 @@ To install MOLT Fetch, download the binary that matches your system. To download | Linux | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-arm64.tgz) | | Mac | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-arm64.tgz) | -For previous binaries, see the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). For releases v0.0.6 and earlier, see the [MOLT repository](https://github.com/cockroachdb/molt/releases). +For previous binaries, refer to the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). + +{{site.data.alerts.callout_info}} +MOLT Fetch is supported on Red Hat Enterprise Linux (RHEL) 9 and above. +{{site.data.alerts.end}} ## Setup Complete the following items before using MOLT Fetch: -- Ensure that the source and target schemas are identical. Tables with mismatching columns may only be partially migrated. +- Follow the recommendations in [Best practices](#best-practices) and [Security recommendations](#security-recommendations). -- Ensure that the SQL user running MOLT Fetch has the required privileges to run [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}#required-privileges) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}#required-privileges) statements, depending on your intended [mode](#fetch-mode). +- Ensure that the source and target schemas are identical, unless you enable automatic schema creation with the [`'drop-on-target-and-recreate'`](#target-table-handling) option. If you are creating the target schema manually, review the behaviors in [Mismatch handling](#mismatch-handling). -- To enable the [CDC cursor](#cdc-cursor) for ongoing replication: +- Ensure that the SQL user running MOLT Fetch has [`SELECT` privileges]({% link {{ page.version.version }}/grant.md %}#supported-privileges) on the source and target CockroachDB databases, along with the required privileges to run [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}#required-privileges) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}#required-privileges) (depending on the [fetch mode](#fetch-mode)) on CockroachDB, as described on their respective pages. - - If you are migrating from PostgreSQL, enable logical replication. Set [wal_level](https://www.postgresql.org/docs/current/runtime-config-wal.html) to `logical` in `postgresql.conf` or in the SQL shell. +- If you plan to use continuous replication (using either [`--ongoing-replication`](#replication) or the [CDC cursor](#cdc-cursor)): - - If you are migrating from MySQL, enable [GTID](https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html) consistency. Set `gtid-mode` and `enforce-gtid-consistency` to `ON` in `mysql.cnf`, in the SQL shell, or as flags in the `mysql` start command. + - If you are migrating from PostgreSQL, enable logical replication. In `postgresql.conf` or in the SQL shell, set [`wal_level`](https://www.postgresql.org/docs/current/runtime-config-wal.html) to `logical`. + + - If you are migrating from MySQL, enable [GTID](https://dev.mysql.com/doc/refman/8.0/en/replication-options-gtids.html) consistency. In `mysql.cnf`, in the SQL shell, or as flags in the `mysql` start command, set `gtid-mode` and `enforce-gtid-consistency` to `ON` and set `binlog_row_metadata` to `full`. - Percent-encode the connection strings for the source database and [CockroachDB]({% link {{ page.version.version }}/connect-to-the-database.md %}). This ensures that the MOLT tools can parse special characters in your password. @@ -91,40 +93,131 @@ Complete the following items before using MOLT Fetch: ~~~ - Ensure the Google Cloud Storage bucket is created and accessible to CockroachDB. - + +## Best practices + +- To prevent connections from terminating prematurely during data export, set the following to high values on the source database: + + - **Maximum allowed number of connections:** MOLT Fetch can export data across multiple connections. The number of connections it will create is the number of shards ([`--export-concurrency`](#global-flags)) multiplied by the number of tables ([`--table-concurrency`](#global-flags)) being exported concurrently. + - **Maximum lifetime of a connection:** This is particularly important for MySQL sources, which can only use a single connection to move data. See the following note. + +- If a MySQL database is set as a [source](#source-and-target-databases), the [`--table-concurrency`](#global-flags) and [`--export-concurrency`](#global-flags) flags **cannot** be set above `1`. If these values are changed, MOLT Fetch returns an error. This guarantees consistency when moving data from MySQL, due to MySQL limitations. MySQL data is migrated to CockroachDB one table and shard at a time, using [`WITH CONSISTENT SNAPSHOT`](https://dev.mysql.com/doc/refman/8.0/en/commit.html) transactions. + +- To prevent memory outages during data export of tables with large rows, estimate the amount of memory used to export a table: + + ~~~ + --row-batch-size * --export-concurrency * average size of the table rows + ~~~ + + If you are exporting more than one table at a time (i.e., [`--table-concurrency`](#global-flags) is set higher than `1`), add the estimated memory usage for the tables with the largest row sizes. Ensure that you have sufficient memory to run `molt fetch`, and adjust `--row-batch-size` accordingly. + +- If a table in the source database is much larger than the other tables, [filter and export the largest table](#schema-and-table-selection) in its own `molt fetch` task. Repeat this for each of the largest tables. Then export the remaining tables in another task. + +- When using [`IMPORT INTO` mode](#fetch-mode) to load tables into CockroachDB, if the fetch process terminates before the import job completes, the hanging import job on the target database will keep the table offline. To make this table accessible again, [manually resume or cancel the job]({% link {{ page.version.version }}/import-into.md %}#view-and-control-import-jobs). Then resume `molt fetch` using [continuation](#fetch-continuation), or restart the process from the beginning. + +## Security recommendations + +Cockroach Labs **strongly** recommends the following: + +### Secure connections + +- Use secure connections to the source and [target CockroachDB database]({% link {{ page.version.version }}/connection-parameters.md %}#additional-connection-parameters) whenever possible. +- By default, insecure connections (i.e., `sslmode=disable` on PostgreSQL; `sslmode` not set on MySQL) are disallowed. When using an insecure connection, `molt fetch` returns an error. To override this check, you can enable the `--allow-tls-mode-disable` flag. Do this **only** for testing, or if a secure SSL/TLS connection to the source or target database is not possible. + +### Connection strings + +- Avoid plaintext connection strings. +- Provide your connection strings as environment variables. +- If possible within your security infrastructure, use an external secrets manager to load the environment variables from stored secrets. + + For example, to export connection strings as environment variables: + + ~~~ shell + export SOURCE="postgres://postgres:postgres@localhost:5432/molt?sslmode=verify-full" + export TARGET="postgres://root@localhost:26257/molt?sslmode=verify-full" + ~~~ + + Afterward, to pass the environment variables in `molt fetch` commands: + + ~~~ shell + molt fetch \ + --source "$SOURCE" \ + --target "$TARGET" \ + --table-filter 'employees' \ + --bucket-path 's3://molt-test' \ + --table-handling truncate-if-exists + ~~~ + +### Secure cloud storage + +- When using [cloud storage](#cloud-storage) for your intermediate store, ensure that access control is properly configured. Refer to the [GCP](https://cloud.google.com/storage/docs/access-control) or [AWS](https://docs.aws.amazon.com/AmazonS3/latest/userguide/security-iam.html) documentation. +- Do not use public cloud storage in production. + +### Perform a dry run + +To verify that your connections and configuration work properly, run MOLT Fetch in a staging environment before moving any data in production. Use a test or development environment that is as similar as possible to production. + +## Commands + +| Command | Usage | +|---------|---------------------------------------------------------------------------------------------------| +| `fetch` | Start the fetch process. This loads data from a source database to a target CockroachDB database. | + +### Subcommands + +| Command | Usage | +|--------------|----------------------------------------------------------------------| +| `tokens list` | List active [continuation tokens](#list-active-continuation-tokens). | + ## Flags -| Flag | Description | -|-----------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `--source` | (Required) Connection string for the source database. For details, see [Source and target databases](#source-and-target-databases). | -| `--target` | (Required) Connection string for the target database. For details, see [Source and target databases](#source-and-target-databases). | -| `--bucket-path` | The path within the [cloud storage](#cloud-storage) bucket where intermediate files are written (e.g., `'s3://bucket/path'` or `'gs://bucket/path'`). | -| `--cleanup` | Whether to delete intermediate files after moving data using [cloud or local storage](#data-path). **Note:** Cleanup does not occur on [continuation](#fetch-continuation). | -| `--compression` | Compression method for data when using [`IMPORT INTO` mode](#fetch-mode) (`gzip`/`none`).

**Default:** `gzip` | -| `--continuation-file-name` | Restart fetch at the specified filename if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | -| `--continuation-token` | Restart fetch at a specific table, using the specified continuation token, if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | -| `--direct-copy` | Enables [direct copy mode](#fetch-mode), which copies data directly from source to target without using an intermediate store. | -| `--export-concurrency` | Number of concurrent threads to use for data export. **Note:** This number will be multiplied by the number of tables being moved in `--table-concurrency`. Ensure your machine has sufficient resources to handle this level of concurrency.

**Default:** `4` | -| `--fetch-id` | Restart fetch process corresponding to the specified ID. If `--continuation-file-name` or `--continuation-token` are not specified, fetch restarts for all failed tables. | -| `--flush-rows` | Number of rows before the source data is flushed to intermediate files. **Note:** If `--flush-size` is also specified, the fetch behavior is based on the flag whose criterion is met first. | -| `--flush-size` | Size (in bytes) before the source data is flushed to intermediate files. **Note:** If `--flush-rows` is also specified, the fetch behavior is based on the flag whose criterion is met first. | -| `--local-path` | The path within the [local file server](#local-file-server) where intermediate files are written (e.g., `data/migration/cockroach`). `--local-path-listen-addr` must be specified. | -| `--local-path-crdb-access-addr` | Address of a [local file server](#local-file-server) that is reachable by CockroachDB. This flag is only necessary if CockroachDB cannot reach the local address specified with `--local-path-listen-addr` (e.g., when moving data to a CockroachDB {{ site.data.products.cloud }} deployment).

**Default:** Value of `--local-path-listen-addr`. `--local-path` and `--local-path-listen-addr` must be specified. | -| `--local-path-listen-addr` | Write intermediate files to a [local file server](#local-file-server) at the specified address (e.g., `'localhost:3000'`). `--local-path` must be specified. | -| `--log-file` | Write messages to the specified log filename. If not specified, messages are only written to `stdout`. | -| `--logging` | Level at which to log messages (`'trace'`/`'debug'`/`'info'`/`'warn'`/`'error'`/`'fatal'`/`'panic'`).

**Default:** `'info'` | -| `--metrics-listen-addr` | Address of the metrics endpoint.

**Default:** `'127.0.0.1:3030'` | -| `--pglogical-replication-slot-drop-if-exists` | Drop the replication slot, if specified with `--pglogical-replication-slot-name`. Otherwise, the default replication slot is not dropped. | -| `--pglogical-replication-slot-name` | The name of a replication slot to create before taking a snapshot of data (e.g., `'fetch'`). This flag is only necessary if you want to use a replication slot other than the default slot. | -| `--pglogical-replication-slot-plugin` | The output plugin used for logical replication under `--pglogical-replication-slot-name`.

**Default:** `pgoutput` | -| `--pprof-listen-addr` | Address of the pprof endpoint.

**Default:** `'127.0.0.1:3031'` | -| `--row-batch-size` | Number of rows to select at a time for export from the source database.

**Default:** `100000` | -| `--schema-filter` | Move schemas that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | -| `--table-concurrency` | Number of tables to move at a time. **Note:** This number will be multiplied by the value of `--export-concurrency`. Ensure your machine has sufficient resources to handle this level of concurrency.

**Default:** 4 | -| `--table-filter` | Move tables that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | -| `--table-handling` | How tables are initialized on the target database (`'none'`/`'drop-on-target-and-recreate'`/`'truncate-if-exists'`). For details, see [Target table handling](#target-table-handling).

**Default:** `'none'` | -| `--use-console-writer` | Use the console writer, which has cleaner log output but introduces more latency.

**Default:** `false` (log as structured JSON) | -| `--use-copy` | Use [`COPY FROM` mode](#fetch-mode) to move data. This makes tables queryable during data load, but is slower than `IMPORT INTO` mode. For details, see [Fetch mode](#fetch-mode). | +### Global flags + +| Flag | Description | +|-----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `--source` | (Required) Connection string for the source database. For details, see [Source and target databases](#source-and-target-databases). | +| `--target` | (Required) Connection string for the target database. For details, see [Source and target databases](#source-and-target-databases). | +| `--allow-tls-mode-disable` | Allow insecure connections to databases. Secure SSL/TLS connections should be used by default. This should be enabled **only** if secure SSL/TLS connections to the source or target database are not possible. | +| `--bucket-path` | The path within the [cloud storage](#cloud-storage) bucket where intermediate files are written (e.g., `'s3://bucket/path'` or `'gs://bucket/path'`). | +| `--cleanup` | Whether to delete intermediate files after moving data using [cloud or local storage](#data-path). **Note:** Cleanup does not occur on [continuation](#fetch-continuation). | +| `--compression` | Compression method for data when using [`IMPORT INTO` mode](#fetch-mode) (`gzip`/`none`).

**Default:** `gzip` | +| `--continuation-file-name` | Restart fetch at the specified filename if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | +| `--continuation-token` | Restart fetch at a specific table, using the specified continuation token, if the process encounters an error. `--fetch-id` must be specified. For details, see [Fetch continuation](#fetch-continuation). | +| `--crdb-pts-duration` | The duration for which each timestamp used in data export from a CockroachDB source is protected from garbage collection. This ensures that the data snapshot remains consistent. For example, if set to `24h`, each timestamp is protected for 24 hours from the initiation of the export job. This duration is extended at regular intervals specified in `--crdb-pts-refresh-interval`.

**Default:** `24h0m0s` | +| `--crdb-pts-refresh-interval` | The frequency at which the protected timestamp's validity is extended. This interval maintains protection of the data snapshot until data export from a CockroachDB source is completed. For example, if set to `10m`, the protected timestamp's expiration will be extended by the duration specified in `--crdb-pts-duration` (e.g., `24h`) every 10 minutes while export is not complete.

**Default:** `10m0s` | +| `--direct-copy` | Enables [direct copy mode](#fetch-mode), which copies data directly from source to target without using an intermediate store. | +| `--export-concurrency` | Number of shards to export at a time, each on a dedicated thread. **Note:** The number of concurrent threads is the product of `--export-concurrency` and `--table-concurrency`. See [Best practices](#best-practices).

This value **cannot** be set higher than `1` when moving data from MySQL. Refer to [Best practices](#best-practices).

**Default:** `4` with a PostgreSQL source; `1` with a MySQL source | +| `--fetch-id` | Restart fetch process corresponding to the specified ID. If `--continuation-file-name` or `--continuation-token` are not specified, fetch restarts for all failed tables. | +| `--flush-rows` | Number of rows before the source data is flushed to intermediate files. **Note:** If `--flush-size` is also specified, the fetch behavior is based on the flag whose criterion is met first. | +| `--flush-size` | Size (in bytes) before the source data is flushed to intermediate files. **Note:** If `--flush-rows` is also specified, the fetch behavior is based on the flag whose criterion is met first. | +| `--local-path` | The path within the [local file server](#local-file-server) where intermediate files are written (e.g., `data/migration/cockroach`). `--local-path-listen-addr` must be specified. | +| `--local-path-crdb-access-addr` | Address of a [local file server](#local-file-server) that is reachable by CockroachDB. This flag is only necessary if CockroachDB cannot reach the local address specified with `--local-path-listen-addr` (e.g., when moving data to a CockroachDB {{ site.data.products.cloud }} deployment).

**Default:** Value of `--local-path-listen-addr`. `--local-path` and `--local-path-listen-addr` must be specified. | +| `--local-path-listen-addr` | Write intermediate files to a [local file server](#local-file-server) at the specified address (e.g., `'localhost:3000'`). `--local-path` must be specified. | +| `--log-file` | Write messages to the specified log filename. If not specified, messages are only written to `stdout`. | +| `--logging` | Level at which to log messages (`'trace'`/`'debug'`/`'info'`/`'warn'`/`'error'`/`'fatal'`/`'panic'`).

**Default:** `'info'` | +| `--metrics-listen-addr` | Address of the metrics endpoint.

**Default:** `'127.0.0.1:3030'` | +| `--non-interactive` | Run the fetch process without interactive prompts. This is recommended **only** when running `molt fetch` in an automated process (i.e., a job or continuous integration). | +| `--ongoing-replication` | Enable continuous [replication](#replication) to begin after the fetch process succeeds (i.e., initial source data is loaded into CockroachDB). | +| `--pglogical-replication-slot-drop-if-exists` | Drop the replication slot, if specified with `--pglogical-replication-slot-name`. Otherwise, the default replication slot is not dropped. | +| `--pglogical-replication-slot-name` | The name of a replication slot to create before taking a snapshot of data (e.g., `'fetch'`). **Required** in order to perform continuous [replication](#replication) from a source PostgreSQL database. | +| `--pglogical-replication-slot-plugin` | The output plugin used for logical replication under `--pglogical-replication-slot-name`.

**Default:** `pgoutput` | +| `--pprof-listen-addr` | Address of the pprof endpoint.

**Default:** `'127.0.0.1:3031'` | +| `--replicator-flags` | If continuous [replication](#replication) is enabled with `--ongoing-replication`, specify Replicator flags ([PostgreSQL](https://github.com/cockroachdb/replicator/wiki/PGLogical#postgresql-logical-replication) or [MySQL](https://github.com/cockroachdb/replicator/wiki/MYLogical#mysqlmariadb-replication)) to override. | +| `--row-batch-size` | Number of rows per shard to export at a time. See [Best practices](#best-practices).

**Default:** `100000` | +| `--schema-filter` | Move schemas that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | +| `--table-concurrency` | Number of tables to export at a time. **Note:** The number of concurrent threads is the product of `--export-concurrency` and `--table-concurrency`. See [Best practices](#best-practices).

This value **cannot** be set higher than `1` when moving data from MySQL. See [Best practices](#best-practices).

**Default:** `4` with a PostgreSQL source; `1` with a MySQL source | +| `--table-filter` | Move tables that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression).

**Default:** `'.*'` | +| `--table-handling` | How tables are initialized on the target database (`'none'`/`'drop-on-target-and-recreate'`/`'truncate-if-exists'`). For details, see [Target table handling](#target-table-handling).

**Default:** `'none'` | +| `--type-map-file` | Path to a JSON file that contains explicit type mappings for automatic schema creation, when enabled with `--table-handling 'drop-on-target-and-recreate'`. For details on the JSON format and valid type mappings, see [type mapping](#type-mapping). | +| `--use-console-writer` | Use the console writer, which has cleaner log output but introduces more latency.

**Default:** `false` (log as structured JSON) | +| `--use-copy` | Use [`COPY FROM` mode](#fetch-mode) to move data. This makes tables queryable during data load, but is slower than `IMPORT INTO` mode. For details, see [Fetch mode](#fetch-mode). | + +### `tokens list` flags + +| Flag | Description | +|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------| +| `--conn-string` | (Required) Connection string for the target database. For details, see [List active continuation tokens](#list-active-continuation-tokens). | +| `-n`, `--num-results` | Number of results to return. | ## Usage @@ -132,6 +225,10 @@ The following sections describe how to use the `molt fetch` [flags](#flags). ### Source and target databases +{{site.data.alerts.callout_success}} +Follow the recommendations in [Connection strings](#connection-strings). +{{site.data.alerts.end}} + `--source` specifies the connection string of the source database. PostgreSQL or CockroachDB: @@ -157,11 +254,11 @@ MySQL: ### Fetch mode -MOLT Fetch can use either [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}) to move data to CockroachDB. +MOLT Fetch can use either [`IMPORT INTO`]({% link {{ page.version.version }}/import-into.md %}) or [`COPY FROM`]({% link {{ page.version.version }}/copy-from.md %}) to load data into CockroachDB. By default, MOLT Fetch uses `IMPORT INTO`: -- `IMPORT INTO` mode achieves the highest throughput, but [requires taking the tables **offline**]({% link {{ page.version.version }}/import-into.md %}#considerations) to achieve its import speed. +- `IMPORT INTO` mode achieves the highest throughput, but [requires taking the tables **offline**]({% link {{ page.version.version }}/import-into.md %}#considerations) to achieve its import speed. Tables are taken back online once an [import job]({% link {{ page.version.version }}/import-into.md %}#view-and-control-import-jobs) completes successfully. See [Best practices](#best-practices). - `IMPORT INTO` mode supports compression using the `--compression` flag, which reduces the amount of storage used. `--use-copy` configures MOLT Fetch to use `COPY FROM`: @@ -179,6 +276,10 @@ MOLT Fetch can move the source data to CockroachDB via [cloud storage](#cloud-st #### Cloud storage +{{site.data.alerts.callout_success}} +Follow the recommendations in [Secure cloud storage](#secure-cloud-storage). +{{site.data.alerts.end}} + `--bucket-path` specifies that MOLT Fetch should write intermediate files to a path within a [Google Cloud Storage](https://cloud.google.com/storage/docs/buckets) or [Amazon S3](https://aws.amazon.com/s3/) bucket to which you have the necessary permissions. For example: Google Cloud Storage: @@ -275,23 +376,139 @@ To drop existing tables and create new tables before loading the data, use `'dro --table-handling 'drop-on-target-and-recreate' ~~~ -With each option, MOLT Fetch creates a new CockroachDB table to load the source data if one does not exist. +When using the `'drop-on-target-and-recreate'` option, MOLT Fetch creates a new CockroachDB table to load the source data if one does not already exist. To guide the automatic schema creation, you can [explicitly map source types to CockroachDB types](#type-mapping). + +#### Mismatch handling + +If either [`'none'`](#target-table-handling) or [`'truncate-if-exists'`](#target-table-handling) is set, `molt fetch` loads data into the existing tables on the target CockroachDB database. If the target schema mismatches the source schema, `molt fetch` will exit early in [certain cases](#exit-early), and will need to be re-run from the beginning. + +{{site.data.alerts.callout_info}} +This does not apply when [`'drop-on-target-and-recreate'`](#target-table-handling) is specified, since this mode automatically creates a compatible CockroachDB schema. +{{site.data.alerts.end}} + +`molt fetch` exits early in the following cases, and will output a log with a corresponding `mismatch_tag` and `failable_mismatch` set to `true`: + +- A source table is missing a primary key. +- A source and table primary key have mismatching types. +- A [`STRING`]({% link {{ page.version.version }}/string.md %}) primary key has a different [collation]({% link {{ page.version.version }}/collate.md %}) on the source and target. +- A source and target column have mismatching types that are not [allowable mappings](#type-mapping). +- A target table is missing a column that is in the corresponding source table. +- A source column is nullable, but the corresponding target column is not nullable (i.e., the constraint is more strict on the target). + +`molt fetch` can continue in the following cases, and will output a log with a corresponding `mismatch_tag` and `failable_mismatch` set to `false`: + +- A target table has a column that is not in the corresponding source table. +- A source column has a `NOT NULL` constraint, and the corresponding target column is nullable (i.e., the constraint is less strict on the target). +- A [`DEFAULT`]({% link {{ page.version.version }}/default-value.md %}), [`CHECK`]({% link {{ page.version.version }}/check.md %}), [`FOREIGN KEY`]({% link {{ page.version.version }}/foreign-key.md %}), or [`UNIQUE`]({% link {{ page.version.version }}/unique.md %}) constraint is specified on a target column and not on the source column. + +#### Type mapping + +If [`'drop-on-target-and-recreate'`](#target-table-handling) is set, MOLT Fetch automatically creates a CockroachDB schema that is compatible with the source data. The column types are determined as follows: + +- PostgreSQL types are mapped to existing CockroachDB [types]({% link {{ page.version.version }}/data-types.md %}) that have the same [`OID`]({% link {{ page.version.version }}/oid.md %}). +- The following MySQL types are mapped to corresponding CockroachDB types: + + | MySQL type | CockroachDB type | + |-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------| + | `CHAR`, `CHARACTER`, `VARCHAR`, `NCHAR`, `NVARCHAR` | [`VARCHAR`]({% link {{ page.version.version }}/string.md %}) | + | `TINYTEXT`, `TEXT`, `MEDIUMTEXT`, `LONGTEXT` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | + | `GEOMETRY` | [`GEOMETRY`]({% link {{ page.version.version }}/architecture/glossary.md %}#geometry) | + | `LINESTRING` | [`LINESTRING`]({% link {{ page.version.version }}/linestring.md %}) | + | `POINT` | [`POINT`]({% link {{ page.version.version }}/point.md %}) | + | `POLYGON` | [`POLYGON`]({% link {{ page.version.version }}/polygon.md %}) | + | `MULTIPOINT` | [`MULTIPOINT`]({% link {{ page.version.version }}/multipoint.md %}) | + | `MULTILINESTRING` | [`MULTILINESTRING`]({% link {{ page.version.version }}/multilinestring.md %}) | + | `MULTIPOLYGON` | [`MULTIPOLYGON`]({% link {{ page.version.version }}/multipolygon.md %}) | + | `GEOMETRYCOLLECTION`, `GEOMCOLLECTION` | [`GEOMETRYCOLLECTION`]({% link {{ page.version.version }}/geometrycollection.md %}) | + | `JSON` | [`JSONB`]({% link {{ page.version.version }}/jsonb.md %}) | + | `TINYINT`, `INT1` | [`INT2`]({% link {{ page.version.version }}/int.md %}) | + | `BLOB` | [`BYTES`]({% link {{ page.version.version }}/bytes.md %}) | + | `SMALLINT`, `INT2` | [`INT2`]({% link {{ page.version.version }}/int.md %}) | + | `MEDIUMINT`, `INT`, `INTEGER`, `INT4` | [`INT4`]({% link {{ page.version.version }}/int.md %}) | + | `BIGINT`, `INT8` | [`INT`]({% link {{ page.version.version }}/int.md %}) | + | `FLOAT` | [`FLOAT4`]({% link {{ page.version.version }}/float.md %}) | + | `DOUBLE` | [`FLOAT`]({% link {{ page.version.version }}/float.md %}) | + | `DECIMAL`, `NUMERIC`, `REAL` | [`DECIMAL`]({% link {{ page.version.version }}/decimal.md %}) (Negative scale values are autocorrected to `0`) | + | `BINARY`, `VARBINARY` | [`BYTES`]({% link {{ page.version.version }}/bytes.md %}) | + | `DATETIME` | [`TIMESTAMP`]({% link {{ page.version.version }}/timestamp.md %}) | + | `TIMESTAMP` | [`TIMESTAMPTZ`]({% link {{ page.version.version }}/timestamp.md %}) | + | `TIME` | [`TIME`]({% link {{ page.version.version }}/time.md %}) | + | `BIT` | [`VARBIT`]({% link {{ page.version.version }}/bit.md %}) | + | `DATE` | [`DATE`]({% link {{ page.version.version }}/date.md %}) | + | `TINYBLOB`, `MEDIUMBLOB`, `LONGBLOB` | [`BYTES`]({% link {{ page.version.version }}/bytes.md %}) | + | `BOOL`, `BOOLEAN` | [`BOOL`]({% link {{ page.version.version }}/bool.md %}) | + | `ENUM` | [`ANY_ENUM`]({% link {{ page.version.version }}/enum.md %}) | + +- To override the default mappings for automatic schema creation, you can map source to target CockroachDB types explicitly. These are specified using a JSON file and `--type-map-file`. The allowable custom mappings are valid CockroachDB aliases, casts, and the following mappings specific to MOLT Fetch and [Verify]({% link {{ page.version.version }}/molt-verify.md %}): + + - [`TIMESTAMP`]({% link {{ page.version.version }}/timestamp.md %}) <> [`TIMESTAMPTZ`]({% link {{ page.version.version }}/timestamp.md %}) + - [`VARCHAR`]({% link {{ page.version.version }}/string.md %}) <> [`UUID`]({% link {{ page.version.version }}/uuid.md %}) + - [`BOOL`]({% link {{ page.version.version }}/bool.md %}) <> [`INT2`]({% link {{ page.version.version }}/int.md %}) + - [`VARBIT`]({% link {{ page.version.version }}/bit.md %}) <> [`TEXT`]({% link {{ page.version.version }}/string.md %}) + - [`JSONB`]({% link {{ page.version.version }}/jsonb.md %}) <> [`TEXT`]({% link {{ page.version.version }}/string.md %}) + - [`INET`]({% link {{ page.version.version }}/inet.md %}) <> [`TEXT`]({% link {{ page.version.version }}/string.md %}) + +`--type-map-file` specifies the path to the JSON file containing the explicit type mappings. For example: + +{% include_cached copy-clipboard.html %} +~~~ +--type-map-file 'type-mappings.json' +~~~ + +The JSON is formatted as follows: + +~~~ json +[ + { + "table": "public.t1", + "column-type-map": [ + { + "column": "*", + "type-kv": { + "source-type": "int", + "crdb-type": "INT2" + } + }, + { + "column": "name", + "type-kv": { + "source-type": "varbit", + "crdb-type": "string" + } + } + ] + } +] +~~~ + +- `table` specifies the table that will use the custom type mappings in `column-type-map`, written as `{schema}.{table}`. +- `column` specifies the column that will use the custom type mapping in `type-kv`. If `*` is specified, then all columns in the `table` with the matching `source-type` are converted. +- `type-kv` specifies the `source-type` that maps to the target `crdb-type`. ### Fetch continuation -If `molt fetch` exits with an error after loading data from [cloud](#cloud-storage) or [local storage](#local-file-server), you can continue the process from the *continuation point* where it was interrupted. +If MOLT Fetch fails while loading data into CockroachDB from intermediate files, it exits with an error message, fetch ID, and [continuation token](#list-active-continuation-tokens) for each table that failed to load on the target database. You can use this information to continue the process from the *continuation point* where it was interrupted. For an example, see [Continue fetch after encountering an error](#continue-fetch-after-encountering-an-error). -To retry all data starting from the continuation point, include `--fetch-id` and specify the process ID from the `molt fetch` output. +Continuation is only possible under the following conditions: + +- All data has been exported from the source database into intermediate files on [cloud](#cloud-storage) or [local storage](#local-file-server). +- The *initial load* of source data to the target CockroachDB database is incomplete. This means that ongoing [replication](#replication) of source data has not begun. + +{{site.data.alerts.callout_info}} +Only one fetch ID and set of continuation tokens, each token corresponding to a table, are active at any time. See [List active continuation tokens](#list-active-continuation-tokens). +{{site.data.alerts.end}} + +To retry all data starting from the continuation point, reissue the `molt fetch` command and include the `--fetch-id`. {% include_cached copy-clipboard.html %} ~~~ --fetch-id d44762e5-6f70-43f8-8e15-58b4de10a007 ~~~ -To retry a specific table that failed, include both `--fetch-id` and `--continuation-token`. The latter flag specifies a token string that corresponds to a specific table on the source database. A continuation token is written in the `molt fetch` output for each failed table. If the fetch process encounters a subsequent error, it generates a new token for each failed table. +To retry a specific table that failed, include both `--fetch-id` and `--continuation-token`. The latter flag specifies a token string that corresponds to a specific table on the source database. A continuation token is written in the `molt fetch` output for each failed table. If the fetch process encounters a subsequent error, it generates a new token for each failed table. See [List active continuation tokens](#list-active-continuation-tokens). {{site.data.alerts.callout_info}} -This will retry only the table that corresponds to the continuation token. If the fetch process succeeds, there may still be source data that is not yet loaded onto CockroachDB. +This will retry only the table that corresponds to the continuation token. If the fetch process succeeds, there may still be source data that is not yet loaded into CockroachDB. {{site.data.alerts.end}} {% include_cached copy-clipboard.html %} @@ -300,18 +517,71 @@ This will retry only the table that corresponds to the continuation token. If th --continuation-token 011762e5-6f70-43f8-8e15-58b4de10a007 ~~~ -To retry all data starting from a specific file, include both `--fetch-id` and `--continuation-file-name`. The latter flag specifies the filename of an intermediate file in [cloud or local storage](#data-path). All filenames are prepended with `part_` and have the `.tar.gz` or `.csv` extension, depending on compression type (gzip by default). For example: +To retry all data starting from a specific file, include both `--fetch-id` and `--continuation-file-name`. The latter flag specifies the filename of an intermediate file in [cloud or local storage](#data-path). All filenames are prepended with `part_` and have the `.csv.gz` or `.csv` extension, depending on compression type (gzip by default). For example: {% include_cached copy-clipboard.html %} ~~~ --fetch-id d44762e5-6f70-43f8-8e15-58b4de10a007 ---continuation-file-name part_00000003.tar.gz +--continuation-file-name part_00000003.csv.gz ~~~ {{site.data.alerts.callout_info}} Continuation is not possible when using [direct copy mode](#direct-copy). {{site.data.alerts.end}} +#### List active continuation tokens + +To view all active continuation tokens, issue a `molt fetch tokens list` command along with `--conn-string`, which specifies the [connection string]({% link {{ page.version.version }}/connection-parameters.md %}#connect-using-a-url) for the target CockroachDB database. For example: + +{% include_cached copy-clipboard.html %} +~~~ shell +molt fetch tokens list \ +--conn-string 'postgres://root@localhost:26257/defaultdb?sslmode=verify-full' +~~~ + +~~~ ++--------------------------------------+--------------------------------------+------------------+----------------------+ +| ID | FETCH ID | TABLE NAME | FILE NAME | ++--------------------------------------+--------------------------------------+------------------+----------------------+ +| f6f0284c-d9c1-43c9-8fde-af609d0dbd82 | 66443597-5689-4df3-a7b9-9fc5e27180eb | public.employees | part_00000001.csv.gz | ++--------------------------------------+--------------------------------------+------------------+----------------------+ +Continuation Tokens. +~~~ + +### Replication + +`--ongoing-replication` enables logical replication from the source database to the target CockroachDB database. + +{% include_cached copy-clipboard.html %} +~~~ +--ongoing-replication +~~~ + +When the `--ongoing-replication` flag is set, changes on the source database are continuously replicated on CockroachDB. This begins only after the fetch process succeeds—i.e., the initial source data is loaded into CockroachDB—as indicated by a `fetch complete` message in the output. + +Before using this feature, complete the following: + +- Install the Replicator binary. Before running `molt fetch` with continuous replication, [download the binary that matches your system](https://github.com/cockroachdb/replicator/wiki/Installing#automated-builds). The Replicator binary **must** be located in the same directory as your [`molt` binary](#installation). +- Configure the source PostgreSQL or MySQL database for continuous replication, as described in [Setup](#setup). + +If the source is a PostgreSQL database, you must also specify a replication slot name: + +{% include_cached copy-clipboard.html %} +~~~ +--ongoing-replication +--pglogical-replication-slot-name 'replication_slot' +~~~ + +To customize the Replicator behavior (an advanced use case), use `--replicator-flags` to specify one or more Replicator flags ([PostgreSQL](https://github.com/cockroachdb/replicator/wiki/PGLogical#postgresql-logical-replication) or [MySQL](https://github.com/cockroachdb/replicator/wiki/MYLogical#mysqlmariadb-replication)) to override. + +{% include_cached copy-clipboard.html %} +~~~ +--ongoing-replication +--replicator-flags "--applyTimeout '1h' --parallelism 64" +~~~ + +To cancel replication, enter `ctrl-c` to issue a `SIGTERM` signal. This returns an exit code `0`. If replication fails, a non-zero exit code is returned. + ### CDC cursor A change data capture (CDC) cursor is written to the output as `cdc_cursor` at the beginning and end of the fetch process. For example: @@ -324,13 +594,13 @@ You can use the `cdc_cursor` value with an external change data capture (CDC) to ## Examples -The following examples demonstrate how to issue `molt fetch` commands to load data onto CockroachDB. +The following examples demonstrate how to issue `molt fetch` commands to load data into CockroachDB. These examples assume that [secure connections](#secure-connections) to the source and target database are used. {{site.data.alerts.callout_success}} After successfully running MOLT Fetch, you can run [`molt verify`]({% link {{ page.version.version }}/molt-verify.md %}) to confirm that replication worked successfully without missing or mismatched rows. {{site.data.alerts.end}} -### Load PostgreSQL data via S3 +### Load PostgreSQL data via S3 with ongoing replication The following `molt fetch` command uses `IMPORT INTO` to load a subset of tables from a PostgreSQL database to CockroachDB. @@ -342,13 +612,17 @@ molt fetch \ --table-handling 'truncate-if-exists' \ --table-filter 'employees' \ --bucket-path 's3://migration/data/cockroach' \ ---cleanup +--cleanup \ +--pglogical-replication-slot-name 'replication_slot' \ +--ongoing-replication ~~~ - `--table-handling` specifies that existing tables on CockroachDB should be truncated before the source data is loaded. - `--table-filter` filters for tables with the `employees` string in the name. - `--bucket-path` specifies a directory on an [Amazon S3 bucket](#data-path) where intermediate files will be written. - `--cleanup` specifies that the intermediate files should be removed after the source data is loaded. +- `--pglogical-replication-slot-name` specifies a replication slot name to be created on the source PostgreSQL database. This is used in continuous [replication](#replication). +- `--ongoing-replication` starts continuous [replication](#replication) of data from the source database to CockroachDB after the fetch process succeeds. If the fetch process succeeds, the output displays a `fetch complete` message like the following: @@ -356,16 +630,27 @@ If the fetch process succeeds, the output displays a `fetch complete` message li {"level":"info","type":"summary","fetch_id":"f5cb422f-4bb4-4bbd-b2ae-08c4d00d1e7c","num_tables":1,"tables":["public.employees"],"cdc_cursor":"0/3F41E40","net_duration_ms":6752.847625,"net_duration":"000h 00m 06s","time":"2024-03-18T12:30:37-04:00","message":"fetch complete"} ~~~ +{{site.data.alerts.callout_info}} If the fetch process encounters an error, it will exit and can be [continued](#continue-fetch-after-encountering-an-error). +{{site.data.alerts.end}} + +Continuous [replication](#replication) begins immediately afterward: -### Load MySQL data via GCP +~~~ json +{"level":"info","time":"2024-05-13T14:33:07-04:00","message":"starting replicator"} +{"level":"info","time":"2024-05-13T14:36:22-04:00","message":"creating publication"} +~~~ + +To cancel replication, enter `ctrl-c` to issue a `SIGTERM` signal. + +### Load MySQL data via GCP with ongoing replication The following `molt fetch` command uses `COPY FROM` to load a subset of tables from a MySQL database to CockroachDB. {% include_cached copy-clipboard.html %} ~~~ shell molt fetch \ ---source 'mysql://root:password@localhost/molt' \ +--source 'mysql://root:password@localhost/molt?sslcert=.%2fsource_certs%2fclient.root.crt&sslkey=.%2fsource_certs%2fclient.root.key&sslmode=verify-full&sslrootcert=.%2fsource_certs%2fca.crt' \ --target 'postgres://root@localhost:26257/defaultdb?sslmode=verify-full' \ --table-handling 'truncate-if-exists' \ --table-filter 'employees' \ @@ -374,11 +659,13 @@ molt fetch \ --cleanup ~~~ +- `--source` specifies the MySQL connection string and the certificates in URL-encoded format. Secure connections should be used by default. Refer to [Best practices](#best-practices). - `--table-handling` specifies that existing tables on CockroachDB should be truncated before the source data is loaded. - `--table-filter` filters for tables with the `employees` string in the name. - `--bucket-path` specifies a directory on an [Google Cloud Storage bucket](#data-path) where intermediate files will be written. - `--use-copy` specifies that `COPY FROM` is used to load the tables, keeping the source tables online and queryable but loading the data more slowly than `IMPORT INTO`. - `--cleanup` specifies that the intermediate files should be removed after the source data is loaded. +- `--ongoing-replication` starts continuous [replication](#replication) of data from the source database to CockroachDB after the fetch process succeeds. If the fetch process succeeds, the output displays a `fetch complete` message like the following: @@ -386,7 +673,17 @@ If the fetch process succeeds, the output displays a `fetch complete` message li {"level":"info","type":"summary","fetch_id":"f5cb422f-4bb4-4bbd-b2ae-08c4d00d1e7c","num_tables":1,"tables":["public.employees"],"cdc_cursor":"0/3F41E40","net_duration_ms":6752.847625,"net_duration":"000h 00m 06s","time":"2024-03-18T12:30:37-04:00","message":"fetch complete"} ~~~ +{{site.data.alerts.callout_info}} If the fetch process encounters an error, it will exit and can be [continued](#continue-fetch-after-encountering-an-error). +{{site.data.alerts.end}} + +Continuous [replication](#replication) begins immediately afterward: + +~~~ json +{"level":"info","time":"2024-05-13T14:33:07-04:00","message":"starting replicator"} +~~~ + +To cancel replication, enter `ctrl-c` to issue a `SIGTERM` signal. ### Load CockroachDB data via direct copy @@ -395,18 +692,21 @@ The following `molt fetch` command uses `COPY FROM` to load all tables directly {% include_cached copy-clipboard.html %} ~~~ shell molt fetch \ ---source 'postgres://root@localhost:26257/defaultdb?sslmode=verify-full' \ ---target 'postgres://root@localhost:26258/defaultdb?sslmode=verify-full' \ +--source 'postgres://root@localhost:26257/defaultdb?sslmode=disable' \ +--target 'postgres://root@localhost:26258/defaultdb?sslmode=disable' \ --table-handling 'none' \ ---direct-copy +--direct-copy \ +--allow-tls-mode-disable ~~~ +- `--source` specifies `sslmode=disable` to establish an insecure connection. By default, insecure connections are disallowed and should be used **only** for testing or if a secure SSL/TLS connection to the source or target database is not possible. - `--table-handling` specifies that existing tables on the target CockroachDB database should not be modified before the source data is loaded. - `--direct-copy` specifies that `COPY FROM` is used to load the tables directly, without creating intermediate files. +- `--allow-tls-mode-disable` enables insecure connections to the source and target databases. Refer to [Secure connections](#secure-connections). ### Continue fetch after encountering an error -If `molt fetch` encounters an error, it exits with an error message, fetch ID, and continuation token for each table that failed to load on the target database. You can use these values to [continue the fetch process](#fetch-continuation) from where it was interrupted. +If the fetch process encounters an error, it exits with an error message, fetch ID, and continuation token for each table that failed to load on the target database. You can use these values to [continue the fetch process](#fetch-continuation) from where it was interrupted. ~~~ json {"level":"info","table":"public.tbl1","file_name":"shard_01_part_00000001.csv","message":"creating or updating token for duplicate key value violates unique constraint \"tbl1_pkey\"; Key (id)=(22) already exists."} @@ -416,6 +716,10 @@ If `molt fetch` encounters an error, it exits with an error message, fetch ID, a To retry a specific table, reissue the initial `molt fetch` command and include the fetch ID and a continuation token: +{{site.data.alerts.callout_success}} +You can use `molt fetch tokens list` to list all active continuation tokens. Refer to [List active continuation tokens](#list-active-continuation-tokens). +{{site.data.alerts.end}} + {% include_cached copy-clipboard.html %} ~~~ shell molt fetch \ @@ -424,7 +728,15 @@ molt fetch \ --continuation-token '5e7c7173-101c-4539-9b8d-28fad37d0240' ~~~ -To retry all tables that failed, exclude `--continuation-token` from the command. +To retry all tables that failed, exclude `--continuation-token` from the command. When prompted, type `y` to clear all active continuation tokens. To avoid the prompt (e.g., when running `molt fetch` in a job), include the `--non-interactive` flag: + +{% include_cached copy-clipboard.html %} +~~~ shell +molt fetch \ +... \ +--fetch-id '87bf8dc0-803c-4e26-89d5-3352576f92a7' \ +--non-interactive +~~~ ## See also diff --git a/src/current/v24.1/molt-verify.md b/src/current/v24.1/molt-verify.md index 561141a9369..8a56403f29c 100644 --- a/src/current/v24.1/molt-verify.md +++ b/src/current/v24.1/molt-verify.md @@ -39,13 +39,13 @@ To install MOLT Verify, download the binary that matches your system. To downloa | Linux | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.linux-arm64.tgz) | | Mac | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-amd64.tgz) | [Download](https://molt.cockroachdb.com/molt/cli/molt-latest.darwin-arm64.tgz) | -For previous binaries, see the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). For releases v0.0.6 and earlier, see the [MOLT repository](https://github.com/cockroachdb/molt/releases). +For previous binaries, see the [MOLT version manifest](https://molt.cockroachdb.com/molt/cli/versions.html). # Setup Complete the following items before using MOLT Verify: -- Make sure the SQL user running MOLT Verify has read privileges on the necessary tables. +- The SQL user running MOLT Verify must have the [`SELECT` privilege]({% link {{ page.version.version }}/grant.md %}#supported-privileges) on both the source and target CockroachDB tables. - Percent-encode the connection strings for the source database and [CockroachDB]({% link {{ page.version.version }}/connect-to-the-database.md %}). This ensures that the MOLT tools can parse special characters in your password. @@ -73,7 +73,7 @@ Flag | Description ----------|------------ `--source` | (Required) Connection string for the source database. `--target` | (Required) Connection string for the target database. -`--concurrency` | Number of shards to process at a time.
**Default:** 16
For faster verification, set this flag to a higher value. {% comment %}
Note: Table splitting by shard only works for [`INT`]({% link {{ page.version.version }}/int.md %}), [`UUID`]({% link {{ page.version.version }}/uuid.md %}), and [`FLOAT`]({% link {{ page.version.version }}/float.md %}) data types.{% endcomment %} +`--concurrency` | Number of threads to process at a time when reading the tables.
**Default:** 16
For faster verification, set this flag to a higher value. {% comment %}
Note: Table splitting by shard only works for [`INT`]({% link {{ page.version.version }}/int.md %}), [`UUID`]({% link {{ page.version.version }}/uuid.md %}), and [`FLOAT`]({% link {{ page.version.version }}/float.md %}) data types.{% endcomment %} `--row-batch-size` | Number of rows to get from a table at a time.
**Default:** 20000 `--table-filter` | Verify tables that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression). `--schema-filter` | Verify schemas that match a specified [regular expression](https://wikipedia.org/wiki/Regular_expression). @@ -117,15 +117,18 @@ When verification completes, the output displays a summary message like the foll - `num_success` is the number of rows that matched. - `num_conditional_success` is the number of rows that matched while having a column mismatch due to a type difference. This value indicates that all other columns that could be compared have matched successfully. You should manually review the warnings and errors in the output to determine whether the column mismatches can be ignored. -## Limitations +## Known limitations -- While verifying data, MOLT Verify pages 20,000 rows at a time by default, and row values can change between batches, which can lead to temporary inconsistencies in data. Enable `--live` mode to have the tool retry verification on these rows. You can also change the row batch size using the `--row_batch_size` [flag](#flags). -- MySQL enums and set types are not supported. +- MOLT Verify compares 20,000 rows at a time by default, and row values can change between batches, potentially resulting in temporary inconsistencies in data. If `--live` mode is enabled, MOLT Verify retries verification on these rows. To configure the row batch size, use the `--row_batch_size` [flag](#flags). - MOLT Verify checks for collation mismatches on [primary key]({% link {{ page.version.version }}/primary-key.md %}) columns. This may cause validation to fail when a [`STRING`]({% link {{ page.version.version }}/string.md %}) is used as a primary key and the source and target databases are using different [collations]({% link {{ page.version.version }}/collate.md %}). -- MOLT Verify only supports comparing one MySQL database to a whole CockroachDB schema (which is assumed to be `public`). - MOLT Verify might give an error in case of schema changes on either the source or target database. - [Geospatial types]({% link {{ page.version.version }}/spatial-data-overview.md %}#spatial-objects) cannot yet be compared. +The following limitations are specific to MySQL: + +- MySQL enums and set types are not supported. +- MOLT Verify only supports comparing one MySQL database to a whole CockroachDB schema (which is assumed to be `public`). + ## See also - [MOLT Fetch]({% link {{ page.version.version }}/molt-fetch.md %}) diff --git a/src/current/v24.1/physical-cluster-replication-monitoring.md b/src/current/v24.1/physical-cluster-replication-monitoring.md index 92f8dce8315..05ffb3aa7e8 100644 --- a/src/current/v24.1/physical-cluster-replication-monitoring.md +++ b/src/current/v24.1/physical-cluster-replication-monitoring.md @@ -43,7 +43,11 @@ id | name | source_tenant_name | source_cluster_uri ## DB Console -You can use the [**Physical Cluster Replication** dashboard]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}) of the [DB Console]({% link {{ page.version.version }}/ui-overview.md %}) to monitor [logical bytes]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}#logical-bytes) and [SST bytes]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}#sst-bytes) on the standby cluster. +You can use the [**Physical Cluster Replication** dashboard]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}) of the standby cluster's [DB Console]({% link {{ page.version.version }}/ui-overview.md %}) to monitor: + +- [Logical bytes]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}#logical-bytes) +- [SST bytes]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}#sst-bytes) +- [Replication Lag]({% link {{ page.version.version }}/ui-physical-cluster-replication-dashboard.md %}#replication-lag) ## Prometheus @@ -60,7 +64,7 @@ We recommend tracking the following metrics: {{site.data.alerts.callout_info}} **This feature is in [preview]({% link {{ page.version.version }}/cockroachdb-feature-availability.md %}).** It is in active development and subject to change. -The `SHOW EXPERIMENTAL_FINGERPRINTS` statement verifies that the data transmission and ingestion is working as expected while a replication stream is running. Any checksum mismatch likely represents corruption or a bug in CockroachDB. Should you encounter such a mismatch, contact [Support](https://support.cockroachlabs.com/hc/en-us). +The `SHOW EXPERIMENTAL_FINGERPRINTS` statement verifies that the data transmission and ingestion is working as expected while a replication stream is running. Any checksum mismatch likely represents corruption or a bug in CockroachDB. `SHOW EXPERIMENTAL_FINGERPRINTS` is **only** to verify data. Should you encounter such a mismatch, contact [Support](https://support.cockroachlabs.com/hc/en-us). {{site.data.alerts.end}} To verify that the data at a certain point in time is correct on the standby cluster, you can use the [current replicated time]({% link {{ page.version.version }}/show-virtual-cluster.md %}#responses) from the replication job information to run a point-in-time fingerprint on both the primary and standby clusters. This will verify that the transmission and ingestion of the data on the standby cluster, at that point in time, is correct. diff --git a/src/current/v24.1/plpgsql.md b/src/current/v24.1/plpgsql.md index 3985eed1480..d4d52291fc6 100644 --- a/src/current/v24.1/plpgsql.md +++ b/src/current/v24.1/plpgsql.md @@ -581,8 +581,7 @@ A procedure with `OUT` parameters can only be called from a PL/pgSQL routine. Fo ## Known limitations -{% include {{ page.version.version }}/known-limitations/plpgsql-feature-limitations.md %} -{% include {{ page.version.version }}/known-limitations/plpgsql-datatype-limitations.md %} +{% include {{ page.version.version }}/known-limitations/plpgsql-limitations.md %} ## See also diff --git a/src/current/v24.1/read-committed.md b/src/current/v24.1/read-committed.md index c90dd3c0ba0..f361ab71aa6 100644 --- a/src/current/v24.1/read-committed.md +++ b/src/current/v24.1/read-committed.md @@ -15,7 +15,7 @@ docs_area: deploy - You are [migrating an application to CockroachDB]({% link {{ page.version.version }}/migration-overview.md %}) that was built at a `READ COMMITTED` isolation level on the source database, and it is not feasible to modify your application to use `SERIALIZABLE` isolation. -Whereas `SERIALIZABLE` isolation guarantees data correctness by placing transactions into a [serializable ordering]({% link {{ page.version.version }}/demo-serializable.md %}), `READ COMMITTED` isolation permits some [concurrency anomalies](#concurrency-anomalies) in exchange for minimizing transaction aborts, [retries]({% link {{ page.version.version }}/developer-basics.md %}#transaction-retries), and blocking. Compared to `SERIALIZABLE` transactions, `READ COMMITTED` transactions return fewer [serialization errors]({% link {{ page.version.version }}/transaction-retry-error-reference.md %}) that require client-side handling. See [`READ COMMITTED` transaction behavior](#read-committed-transaction-behavior). +Whereas `SERIALIZABLE` isolation guarantees data correctness by placing transactions into a [serializable ordering]({% link {{ page.version.version }}/demo-serializable.md %}), `READ COMMITTED` isolation permits some [concurrency anomalies](#concurrency-anomalies) in exchange for minimizing transaction aborts, [retries]({% link {{ page.version.version }}/developer-basics.md %}#transaction-retries), and blocking. Compared to `SERIALIZABLE` transactions, `READ COMMITTED` transactions do **not** return [serialization errors]({% link {{ page.version.version }}/transaction-retry-error-reference.md %}) that require client-side handling. See [`READ COMMITTED` transaction behavior](#read-committed-transaction-behavior). If your workload is already running well under `SERIALIZABLE` isolation, Cockroach Labs does not recommend changing to `READ COMMITTED` isolation unless there is a specific need. diff --git a/src/current/v24.1/restore.md b/src/current/v24.1/restore.md index 36d4295b84f..76c6cdda5e3 100644 --- a/src/current/v24.1/restore.md +++ b/src/current/v24.1/restore.md @@ -117,20 +117,21 @@ You can control `RESTORE` behavior using any of the following in the `restore_op Option |
Value
| Description -------------------------------------------------------------------+---------------+------------------------------------------------------- +`debug_pause_on` | `"error" ` | Use to have a `RESTORE` [job]({% link {{ page.version.version }}/show-jobs.md %}) self pause when it encounters an error. The `RESTORE` job can then be [resumed]({% link {{ page.version.version }}/resume-job.md %}) after the error has been fixed or [canceled]({% link {{ page.version.version }}/cancel-job.md %}) to rollback the job.

Example: `WITH debug_pause_on='error'` +`DETACHED` | N/A | When `RESTORE` runs with `DETACHED`, the job will execute asynchronously. The job ID is returned after the restore job creation completes. Note that with `DETACHED` specified, further job information and the job completion status will not be returned. For more on the differences between the returned job data, see the [example]({% link {{ page.version.version }}/restore.md %}#restore-a-backup-asynchronously) below. To check on the job status, use the [`SHOW JOBS`]({% link {{ page.version.version }}/show-jobs.md %}) statement.

To run a restore within a [transaction]({% link {{ page.version.version }}/transactions.md %}), use the `DETACHED` option. +`encryption_passphrase` | Passphrase used to create the [encrypted backup]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) | The passphrase used to decrypt the file(s) that were encrypted by the [`BACKUP`]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) statement. +`EXECUTION LOCALITY` | Key-value pairs | Restricts the execution of the restore to nodes that match the defined [locality filter]({% link {{ page.version.version }}/take-locality-restricted-backups.md %}) requirements.

Example: `WITH EXECUTION LOCALITY = 'region=us-west-1a,cloud=aws'` +`incremental_location` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | Restore an incremental backup from the alternate collection URI the backup was originally taken with.

See [Restore incremental backups](#restore-a-specific-full-or-incremental-backup) for more detail. `into_db` | Database name | Use to [change the target database](#restore-tables-into-a-different-database) for table restores. The target database must exist before a restore with `into_db`. (Does not apply to database or cluster restores.)

Example: `WITH into_db = 'newdb'` +`kms` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | The URI of the cryptographic key stored in a key management service (KMS), or a comma-separated list of key URIs, used to [take and restore encrypted backups]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#examples). Refer to [URI Formats]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#uri-formats) on the Encrypted Backups page. The key or keys are used to encrypt the manifest and data files that the `BACKUP` statement generates, decrypt them during a [restore]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}#examples) operation, and list the contents of the backup when using [`SHOW BACKUP`]({% link {{ page.version.version }}/show-backup.md %}).

AWS KMS, Google Cloud KMS, and Azure Key Vault are supported. `new_db_name` | Database name | [Rename a database during a restore](#rename-a-database-on-restore). The existing backed-up database can remain active while the same database is restored with a different name.

Example: `RESTORE DATABASE movr ... WITH new_db_name = 'new_movr'` +`schema_only` | N/A | Verify that a backup is valid by running `RESTORE ... schema_only`, which will restore the backed-up schema without any user data. Refer to [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-a-backup-is-restorable) for detail and an example. +`skip_localities_check` | N/A | Use to skip checking localities of a cluster before a restore when there are mismatched [cluster regions]({% link {{ page.version.version }}/multiregion-overview.md %}#cluster-regions) between the backup's cluster and the target cluster.

Example: `WITH skip_localities_check` `skip_missing_foreign_keys` | N/A | Use to remove the missing [foreign key]({% link {{ page.version.version }}/foreign-key.md %}) constraints before restoring.

Example: `WITH skip_missing_foreign_keys` `skip_missing_sequences` | N/A | Use to ignore [sequence]({% link {{ page.version.version }}/show-sequences.md %}) dependencies (i.e., the `DEFAULT` expression that uses the sequence).

Example: `WITH skip_missing_sequences` `skip_missing_sequence_owners` | N/A | Must be used when restoring either a table that was previously a [sequence owner]({% link {{ page.version.version }}/create-sequence.md %}#owned-by) or a sequence that was previously owned by a table.

Example: `WITH skip_missing_sequence_owners` -`skip_missing_views` | N/A | Use to skip restoring [views]({% link {{ page.version.version }}/views.md %}) that cannot be restored because their dependencies are not being restored at the same time.

Example: `WITH skip_missing_views` -`skip_localities_check` | N/A | Use to skip checking localities of a cluster before a restore when there are mismatched [cluster regions]({% link {{ page.version.version }}/multiregion-overview.md %}#cluster-regions) between the backup's cluster and the target cluster.

Example: `WITH skip_localities_check` `skip_missing_udfs` | N/A | Must be used when restoring a table with referenced [UDF]({% link {{ page.version.version }}/user-defined-functions.md %}) dependencies. Any column's `DEFAULT` expression using UDFs is dropped.

Example: `WITH skip_missing_udfs` -`encryption_passphrase` | Passphrase used to create the [encrypted backup]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) | The passphrase used to decrypt the file(s) that were encrypted by the [`BACKUP`]({% link {{ page.version.version }}/take-and-restore-encrypted-backups.md %}) statement. -`DETACHED` | N/A | When `RESTORE` runs with `DETACHED`, the job will execute asynchronously. The job ID is returned after the restore job creation completes. Note that with `DETACHED` specified, further job information and the job completion status will not be returned. For more on the differences between the returned job data, see the [example]({% link {{ page.version.version }}/restore.md %}#restore-a-backup-asynchronously) below. To check on the job status, use the [`SHOW JOBS`]({% link {{ page.version.version }}/show-jobs.md %}) statement.

To run a restore within a [transaction]({% link {{ page.version.version }}/transactions.md %}), use the `DETACHED` option. -`EXECUTION LOCALITY` | Key-value pairs | Restricts the execution of the restore to nodes that match the defined [locality filter]({% link {{ page.version.version }}/take-locality-restricted-backups.md %}) requirements.

Example: `WITH EXECUTION LOCALITY = 'region=us-west-1a,cloud=aws'` -`debug_pause_on` | `"error" ` | Use to have a `RESTORE` [job]({% link {{ page.version.version }}/show-jobs.md %}) self pause when it encounters an error. The `RESTORE` job can then be [resumed]({% link {{ page.version.version }}/resume-job.md %}) after the error has been fixed or [canceled]({% link {{ page.version.version }}/cancel-job.md %}) to rollback the job.

Example: `WITH debug_pause_on='error'` -`incremental_location` | [`STRING`]({% link {{ page.version.version }}/string.md %}) | Restore an incremental backup from the alternate collection URI the backup was originally taken with.

See [Restore incremental backups](#restore-a-specific-full-or-incremental-backup) for more detail. -`schema_only` | N/A | Verify that a backup is valid by running `RESTORE ... schema_only`, which will restore the backed-up schema without any user data. Refer to [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-a-backup-is-restorable) for detail and an example. +`skip_missing_views` | N/A | Use to skip restoring [views]({% link {{ page.version.version }}/views.md %}) that cannot be restored because their dependencies are not being restored at the same time.

Example: `WITH skip_missing_views` `verify_backup_table_data` | N/A | Run a `schema_only` restore **and** have the restore read all user data from external storage, verify checksums, and discard the user data before writing it to disk. You must also include the `schema_only` option in the `RESTORE` statement with `verify_backup_table_data`. For more detail, see [Backup Validation]({% link {{ page.version.version }}/backup-validation.md %}#validate-backup-table-data-is-restorable). ### Backup file URLs diff --git a/src/current/v24.1/security-reference/security-overview.md b/src/current/v24.1/security-reference/security-overview.md index 202f7a6a5e4..9ba3e7b937f 100644 --- a/src/current/v24.1/security-reference/security-overview.md +++ b/src/current/v24.1/security-reference/security-overview.md @@ -165,11 +165,11 @@ CockroachDB {{ site.data.products.core }} here refers to the situation of a user Network-level Configuration of allowed IP addresses -   + ✓1 ✓ ✓ ✓ - VPC Peering for GCP clusters and AWS PrivateLink for AWS clusters + GCP Private Service Connect (PSC) (Preview) or VPC Peering for GCP clusters and AWS PrivateLink for AWS clusters Non-Repudiation @@ -188,3 +188,5 @@ CockroachDB {{ site.data.products.core }} here refers to the situation of a user CockroachDB, as a distributed SQL database, is uniquely resilient by nature. A cluster can tolerate node failures as long as the majority of nodes remain functional. See Disaster Recovery. + +1: AWS PrivateLink is in preview for multi-region Serverless clusters, and is not supported for single-region Serverless clusters. Refer to Manage AWS PrivateLink. diff --git a/src/current/v24.1/show-jobs.md b/src/current/v24.1/show-jobs.md index acc200e9f8d..d8964ca0dee 100644 --- a/src/current/v24.1/show-jobs.md +++ b/src/current/v24.1/show-jobs.md @@ -12,11 +12,8 @@ The `SHOW JOBS` [statement]({% link {{ page.version.version }}/sql-statements.md - Enterprise [`BACKUP`]({% link {{ page.version.version }}/backup.md %}) and [`RESTORE`]({% link {{ page.version.version }}/restore.md %}). - [Scheduled backups]({% link {{ page.version.version }}/manage-a-backup-schedule.md %}). - [User-created table statistics]({% link {{ page.version.version }}/create-statistics.md %}) created for use by the [cost-based optimizer]({% link {{ page.version.version }}/cost-based-optimizer.md %}). To view [automatic table statistics]({% link {{ page.version.version }}/cost-based-optimizer.md %}#table-statistics), use [`SHOW AUTOMATIC JOBS`](#show-automatic-jobs). -- `SHOW JOBS` now displays newly added columns from `crdb_internal.jobs` (`last_run`, `next_run`, `num_runs`, and `execution_errors`). The columns capture state related to retries, failures, and exponential backoff. - These details can help you understand the status of crucial tasks that can impact the performance of your cluster, as well as help you control them. - - Details for [enterprise changefeeds]({% link {{ page.version.version }}/create-changefeed.md %}), including the [sink URI]({% link {{ page.version.version }}/create-changefeed.md %}#sink-uri) and full table name, are not displayed on running the `SHOW JOBS` statement. For details about [enterprise changefeeds]({% link {{ page.version.version }}/create-changefeed.md %}), including the [sink URI]({% link {{ page.version.version }}/create-changefeed.md %}#sink-uri) and the full table name, use [`SHOW CHANGEFEED JOBS`](#show-changefeed-jobs). +Details for [enterprise changefeeds]({% link {{ page.version.version }}/create-changefeed.md %}), including the [sink URI]({% link {{ page.version.version }}/create-changefeed.md %}#sink-uri) and full table name, are not displayed on running the `SHOW JOBS` statement. For details about [enterprise changefeeds]({% link {{ page.version.version }}/create-changefeed.md %}), including the [sink URI]({% link {{ page.version.version }}/create-changefeed.md %}#sink-uri) and the full table name, use [`SHOW CHANGEFEED JOBS`](#show-changefeed-jobs). To block a call to `SHOW JOBS` that returns after all specified job ID(s) have a terminal state, use [`SHOW JOBS WHEN COMPLETE`](#show-job-when-complete). The statement will return a row per job ID, which provides details of the job execution. Note that while this statement is blocking, it will time out after 24 hours. @@ -65,7 +62,7 @@ Field | Description ------|------------ `job_id` | A unique ID to identify each job. This value is used if you want to control jobs (i.e., [pause]({% link {{ page.version.version }}/pause-job.md %}), [resume]({% link {{ page.version.version }}/resume-job.md %}), or [cancel]({% link {{ page.version.version }}/cancel-job.md %}) it). `job_type` | The type of job (e.g., [`SCHEMA CHANGE`]({% link {{ page.version.version }}/online-schema-changes.md %}), [`NEW SCHEMA CHANGE`]({% link {{ page.version.version }}/online-schema-changes.md %}#declarative-schema-changer), [`KEY VISUALIZER`]({% link {{ page.version.version }}/ui-key-visualizer.md %}), [`MIGRATION`]({% link {{ page.version.version }}/upgrade-cockroach-version.md %}#step-6-finish-the-upgrade), [`BACKUP`]({% link {{ page.version.version }}/backup.md %}), [`RESTORE`]({% link {{ page.version.version }}/restore.md %}), [`IMPORT`]({% link {{ page.version.version }}/import.md %}), [`CHANGEFEED`](#show-changefeed-jobs), [`CREATE STATS`]({% link {{ page.version.version }}/create-statistics.md %}), [`ROW LEVEL TTL`]({% link {{ page.version.version }}/row-level-ttl.md %}), [`REPLICATION STREAM INGESTION`]({% link {{ page.version.version }}/physical-cluster-replication-monitoring.md %}), or [`REPLICATION STREAM PRODUCER`]({% link {{ page.version.version }}/physical-cluster-replication-monitoring.md %})).

For job types of automatic jobs, see [Show automatic jobs](#show-automatic-jobs). -`description` | The statement that started the job, or a textual description of the job. +`description` | The statement that started the job, or a textual description of the job. When you run `SHOW JOBS`, the `description` field is limited to 100 characters. To view the full description for a job, run `SHOW JOB {job ID}`. `statement` | When `description` is a textual description of the job, the statement that started the job is returned in this column. Currently, this field is populated only for the automatic table statistics jobs. `user_name` | The name of the [user]({% link {{ page.version.version }}/security-reference/authorization.md %}#create-and-manage-users) who started the job. `status` | The job's current state. Possible values: `pending`, `paused`, `pause-requested`, `failed`, `succeeded`, `canceled`, `cancel-requested`, `running`, `retry-running`, `retry-reverting`, `reverting`, `revert-failed`.

Refer to [Jobs status](#job-status) for a description of each status. @@ -78,9 +75,6 @@ Field | Description `error` | If the job `failed` with a terminal error, this column will contain the error generated by the failure. `coordinator_id` | The ID of the node running the job. `trace_id` | The job's internal [trace ID]({% link {{ page.version.version }}/show-trace.md %}#trace-description) for inflight debugging. **Note**: This ID can only be used by the Cockroach Labs support team for internal observability. -`last_run` | When a job fails with a retryable error, this column will contain the [`TIMESTAMPTZ`]({% link {{ page.version.version }}/timestamp.md %}) of the last attempt to run the job. -`next_run` | When a job fails with a retryable error, this column will contain the [`TIMESTAMPTZ`]({% link {{ page.version.version }}/timestamp.md %}) of the next attempt to run the job. -`num_runs` | The number of attempts to run the job. `execution_errors` | A list of any retryable errors that a job may have encountered during its lifetime. For details of changefeed-specific responses, see [`SHOW CHANGEFEED JOBS`](#show-changefeed-jobs). diff --git a/src/current/v24.1/stored-procedures.md b/src/current/v24.1/stored-procedures.md index b292997d0a9..58ab75a9995 100644 --- a/src/current/v24.1/stored-procedures.md +++ b/src/current/v24.1/stored-procedures.md @@ -52,7 +52,8 @@ ALTER PROCEDURE delete_earliest_histories RENAME TO delete_histories; Stored procedures have the following limitations: -{% include {{ page.version.version }}/known-limitations/udf-stored-proc-limitations.md %} +{% include {{ page.version.version }}/known-limitations/stored-proc-limitations.md %} +{% include {{ page.version.version }}/known-limitations/routine-limitations.md %} Also refer to the [PL/pgSQL known limitations]({% link {{ page.version.version }}/plpgsql.md %}#known-limitations). diff --git a/src/current/v24.1/ui-physical-cluster-replication-dashboard.md b/src/current/v24.1/ui-physical-cluster-replication-dashboard.md index 936a499e1eb..aa58a3136b6 100644 --- a/src/current/v24.1/ui-physical-cluster-replication-dashboard.md +++ b/src/current/v24.1/ui-physical-cluster-replication-dashboard.md @@ -5,10 +5,6 @@ toc: true docs_area: reference.db_console --- -{{site.data.alerts.callout_info}} -{% include feature-phases/preview.md %} -{{site.data.alerts.end}} - The **Physical Cluster Replication** dashboard in the DB Console lets you monitor the [physical cluster replication]({% link {{ page.version.version }}/physical-cluster-replication-overview.md %}) streams between a primary and standby cluster. To view this dashboard, [access the DB Console]({% link {{ page.version.version }}/ui-overview.md %}#db-console-access) for your standby cluster, click **Metrics** on the left-hand navigation bar, and select **Physical Cluster Replication** from the **Dashboard** dropdown. @@ -49,6 +45,17 @@ Hovering over the graph displays: - The date and time. - The number of SST bytes replicated. +## Replication lag + +DB Console Replication Lag graph showing results over the past hour + +{% include_cached new-in.html version="v24.1" %} The **Replication Lag** graph displays the [replication lag]({% link {{ page.version.version }}/physical-cluster-replication-technical-overview.md %}) between the primary and standby cluster. This is the time between the most up-to-date replicated time and the actual time. + +Hovering over the graph displays: + +- The specific date and time of the replication lag. +- The reported replication lag time. + {% include {{ page.version.version }}/ui/ui-summary-events.md %} ## See also diff --git a/src/current/v24.1/user-defined-functions.md b/src/current/v24.1/user-defined-functions.md index 6828d1f8895..bbec370c7de 100644 --- a/src/current/v24.1/user-defined-functions.md +++ b/src/current/v24.1/user-defined-functions.md @@ -296,7 +296,8 @@ For a deep-dive demo on UDFs, watch the following video: User-defined functions have the following limitations: -{% include {{ page.version.version }}/known-limitations/udf-stored-proc-limitations.md %} +{% include {{ page.version.version }}/known-limitations/udf-limitations.md %} +{% include {{ page.version.version }}/known-limitations/routine-limitations.md %} Also refer to the [PL/pgSQL known limitations]({% link {{ page.version.version }}/plpgsql.md %}#known-limitations).