Advanced configuration EARLY ACCESS
YB-TServer flags
You can use the following YB-TServer flags to tune logical replication deployment configuration:
- ysql_yb_default_replica_identity
- ysql_yb_enable_implicit_dynamic_tables_logical_replication
- enable_table_rewrite_for_cdcsdk_table
- cdcsdk_enable_dynamic_table_support
- cdc_skip_unqualified_tables_for_polling
- cdcsdk_publication_list_refresh_interval_secs
- cdcsdk_max_consistent_records
- cdcsdk_vwal_getchanges_resp_max_size_bytes
- cdc_enable_intra_transactional_before_image
Retention of resources
CDC retains resources (such as WAL segments) that contain information related to the changes involved in the transactions. These resources are typically retained until the consuming client acknowledges the receipt of all the transactions contained in that resource.
Retaining resources has an impact on the system. Clients are expected to consume these transactions within configurable duration limits. Resources will be released if the duration exceeds these configured limits.
Use the cdc_intent_retention_ms and cdc_wal_retention_time_secs flags to control the duration for which resources are retained.
cdc_intent_retention_ms must be no larger than cdc_wal_retention_time_secs * 1000. Equal values are valid, and the defaults (8 hours) are equal. When you change the flags at runtime, set them in an order that keeps intent retention no larger than WAL retention: to increase retention, raise cdc_wal_retention_time_secs first; to decrease it, lower cdc_intent_retention_ms first. A runtime change that violates the constraint is rejected, and the running process is not affected. A YB-Master or YB-TServer doesn't start when its own flags violate this constraint, and the log reports Must be no larger than cdc_wal_retention_time_secs * 1000 or Must be at least cdc_intent_retention_ms (in seconds), depending on which flag is out of range.
Resources are retained for each tablet of a table that is part of a database whose changes are being consumed using a replication slot. This includes those tables that may not be currently part of the publication specification.
Starting from v2024.2.1, the default data retention for CDC is 8 hours, with support for maximum retention up to 24 hours. Prior to v2024.2.1, the default retention for CDC is 4 hours.
Important
When using FULL or DEFAULT replica identities, CDC preserves previous row values for UPDATE and DELETE operations. This is done by retaining history for each row in the database through a suspension of the compaction process. Compaction process is halted by setting retention barriers to prevent cleanup of history for those rows that are yet to be streamed to the CDC client. These retention barriers are dynamically managed and advanced only after the CDC events are streamed and explicitly acknowledged by the client, thus allowing compaction of history for streamed rows.
The cdc_intent_retention_ms flag governs the maximum retention period (default 8 hours). Be aware that any interruption in CDC consumption for extended periods using these replica identities may degrade read performance. This happens because compaction activities are halted in the database when these replica identities are used, leading to inefficient key lookups as reads must traverse multiple SST files.