Skip to main content

Feature Details

The Cross-Cluster Replication (CCR) feature in Doris is primarily used for efficiently synchronizing data between multiple clusters, thereby enhancing business continuity and disaster recovery capabilities. CCR supports various operations in Doris, ensuring data consistency across different clusters. Below are the details of the main Doris operations supported by CCR.

note
  1. The - in Doris Version indicates Doris version 2.0 and above, all versions of CCR. It is recommended to use Doris version 2.0.15 or 2.1.6 or later.
  2. Version requirements for CCR Syncer and Doris: Syncer Version >= Downstream Doris Version >= Upstream Doris Version. Therefore, upgrade Syncer first, then the downstream Doris, and finally the upstream Doris.
  3. CCR currently does not support the separation of storage and computation.

Database​

Database Properties​

Database-level tasks will synchronize the properties of the database during Full Sync.

PropertySupportedDoris VersionSync MethodDescription
replication_allocationSupported-Full Sync
data quotaNot Supported
replica quotaNot Supported

Modify Database Properties​

CCR tasks do not synchronize operations that modify database properties.

PropertySupportedCan Upstream OperateCan Downstream OperateDescription
replication_allocationNot SupportedNoNoOperations on both sides will cause CCR tasks to be interrupted
data quotaNot SupportedYesYes
replica quotaNot SupportedYesYes

Rename Database​

Renaming is not supported for upstream and downstream; if done, it may cause views to stop working.

Table​

Table Properties​

PropertySupportedDoris VersionSync MethodDescription
Table Model (duplicate, unique, aggregate)Supported-SQL
Partition and BucketingSupported-SQL
replication_numSupported-SQL
replication_allocation (resource group)Supported-SQLUpstream must be consistent with downstream, BE tags must match; otherwise, CCR tasks will fail
colocate_withNot Supported
storage_policyNot Supported
dynamic_partitionSupported-SQL
storage_mediumSupported-SQL
auto_bucketSupported-SQL
group_commit seriesSupported-SQL
enable_unique_key_merge_on_writeSupported-SQL
enable_single_replica_compactionSupported-SQL
disable_auto_compactionSupported-SQL
compaction_policySupported-SQL
time_series_compaction seriesSupported-SQL
binlog seriesSupported-SQL
variant_enable_flatten_nestedSupported-SQL
skip_write_index_on_loadSupported-SQL
row_store seriesSupported-SQL
seq columnSupported-SQL
enable_light_schema_changeSupported-SQL
compression_typeSupported-SQL
indexSupported-SQL
bloom_filter_columnsSupported-SQL
bloom_filter_fppSupported
storage_cooldown_timeNot Supported
generated columnSupported-SQL
auto-increment idNot SupportedHas issues

Basic Table Operations​

OperationSupportedDoris VersionSync MethodCan Downstream Operate IndependentlyDescription
create tableSupported-SQL/Partial SyncCannot operate on tables synchronized by CCR tasks.Refer to the properties for creating tables; in most cases, use SQL for synchronization; for some operations, such as when users set certain session variables or when the create table statement includes inverted indexes, use partial sync
drop tableSupported-SQL/Full SyncSame as aboveBefore 2.0.15/2.1.6: Full Sync, after: SQL
rename tableTable-level tasks do not support database-level tasks2.1.8/3.0.4SQLSame as aboveTable-level task renames will cause CCR tasks to stop
replace tableSupported2.1.8/3.0.4SQL/Full SyncSame as aboveUse SQL for database-level synchronization; table-level triggers full synchronization
truncate tableSupported-SQLSame as above
restore tableNot SupportedSame as above

Modify Table Properties​

The synchronization method is SQL.

PropertySupportedDoris VersionCan Upstream OperateCan Downstream OperateDescription
colocateNot SupportedYesNoTriggering full sync on downstream operations will cause data loss
distribution typeNot SupportedNoSame
dynamic partitionNot SupportedYesSame
replication_numNot SupportedNoNo
replication_allocationNot SupportedNo
storage policyNot SupportedNoNo
enable_light_schema_changeNot SupportedCCR can only synchronize lightweight schema changes.
row_storeSupported2.1.8/3.0.4Through Partial Sync
bloom_filter_columnsSupported2.1.8/3.0.4Through Partial Sync
bloom_filter_fppSupported2.1.8/3.0.4Through Partial Sync
bucket numNot SupportedYesNoTriggering full sync on downstream operations will cause data loss
isBeingSyncedNot SupportedNoNo
compaction series propertiesNot SupportedYesNoTriggering full sync on downstream operations will cause data loss
skip_write_index_on_loadNot SupportedYesSame
seq columnSupported-YesNoTriggering full sync on downstream operations will cause data loss
delete sign columnSupported-YesSame
commentSupported2.1.8/3.0.4YesNoTriggering full sync on downstream operations will cause data loss

Column Operations​

Column operations on Base Index in the table.

OperationSupportedDoris VersionSync MethodCan Downstream OperateRemarks
add key columnSupported-Partial SyncNo
add value columnSupported-SQLNo
drop key columnSupported-Partial SyncSame
drop value columnSupported-SQLSame
modify columnSupported-Partial SyncSame
order bySupported-Partial SyncSame
renameSupported2.1.8/3.0.4SQLSame
commentSupported2.1.8/3.0.4SQLSame
note

Adding/dropping value columns requires setting the property "light_schema_change" = "true" when creating the table.

Column operations on Rollup Index in the table.

OperationSupportedDoris VersionSync MethodRemarks
add key columnSupported2.1.8/3.0.4Partial Sync
add value columnSupported2.1.8/3.0.4SQLRequires enabling lightning schema change
drop columnSupported2.1.8/3.0.4Partial Sync
modify columnUnknown2.1.8/3.0.4Partial SyncDoris does not support directly modifying rollup column types
order bySupported2.1.8/3.0.4Partial sync

Rollup​

OperationSupportedDoris VersionSync MethodRemarks
add rollupSupported2.1.8/3.0.4Partial Sync
drop rollupSupported2.1.8/3.0.4SQL
rename rollupSupported2.1.8/3.0.4SQL

Index​

Inverted Index

OperationSupportedDoris VersionSync MethodRemarks
create indexSupported2.1.8/3.0.4Partial Sync
drop indexSupported2.1.8/3.0.4SQL
build indexSupported2.1.8/3.0.4SQL

Bloom Filter

OperationSupportedDoris VersionSync MethodRemarks
add bloom filterSupported2.1.8/3.0.4Partial Sync
alter bloom filterSupported2.1.8/3.0.4Partial SyncThis refers to modifying bloom_filter_columns
drop bloom filterSupported2.1.8/3.0.4Partial Sync

Data​

Import​

Import MethodSupportedDoris VersionSync MethodCan Downstream OperateDescription
stream loadSupported (except for temporary partitions)-TXNNo, if downstream imports, subsequent triggers of full or Partial Sync will cause data lossUpstream transactions are visible, i.e., data is visible when generating binlog, downstream starts syncing.
broker loadSupported (except for temporary partitions)-TXNSameSame
routine loadSupported (except for temporary partitions)-TXNSameSame
mysql loadSupported (except for temporary partitions)-TXNSameSame
group commitSupported (except for temporary partitions)2.1TXNSameSame

Data Operations​

OperationSupportedDoris VersionSync MethodCan Downstream OperateDescription
deleteSupported-TXNNo, if downstream operates, subsequent triggers of full or Partial Sync will cause data lossUpstream transactions are visible, i.e., data is visible when generating binlog, downstream starts syncing.
updateSupported-TXNSameSame
insertSupported-TXNSameSame
insert into overwriteSupported (except for temporary partitions)2.1.6Partial SyncSameSame
insert into overwriteSupported (except for temporary partitions)2.0full syncSameSame
Explicit transaction (3.0) begin commitNot Supported

Partition Operations​

OperationSupportedDoris VersionSync MethodCan Downstream Operate IndependentlyDescription
add partitionSupported-SQLNo, subsequent triggers of Full Sync or Partial Sync will cause downstream operations to be lostCooldown time property and its behavior are unknown
add temp partitionNot SupportedSameBackup does not support temp partition; starting from Doris 2.1.8/3.0.4, you can modify upstream FE configuration: ignore_backup_tmp_partitions to bypass this issue
drop partitionSupported-SQL/Full SyncSameBefore 2.0.15/2.1.6: Full Sync, after: SQL
replace partitionSupported2.1.7/3.0.3Partial SyncSamePartial Sync only supports strict range and non-temp partition replace method, otherwise it will trigger Full Sync.
modify partitionNot SupportedSameRefers to modifying the property of the partition
rename partitionSupported2.1.8/3.0.4SQLSame

Views​

OperationSupportedDoris VersionSync MethodRemarks
create viewSupported-SQLCan work when upstream and downstream have the same name; if downstream already exists, it will be deleted before creation
alter viewSupported2.1.8/3.0.4SQL
drop viewSupported2.1.8/3.0.4SQL

::: note

Due to limitations in Doris implementation, column names/view names in views cannot be the same as database names.

:::

Materialized Views​

Synchronizing materialized views

OperationSupportedDoris VersionSync MethodRemarks
create materialized viewSupported2.1.8/3.0.4Partial SyncCan work when upstream and downstream have the same name; if different names, downstream needs to manually rebuild the view.
drop materialized viewSupported2.1.8/3.0.4SQL

Asynchronous materialized views

OperationSupported
create async materialized viewNot Supported
alter async materialized viewNot Supported
drop async materialized viewNot Supported
refreshNot Supported
pauseNot Supported
resumeNot Supported

Statistics​

Not synchronized between upstream and downstream, operate independently.

Others​

OperationSupported
external tableNot Supported
recycle binNot Supported
catalogNot Supported
workload groupNot Supported
jobNot Supported
functionNot Supported
policyNot Supported
userNot Supported
cancel alter jobSupported