prosync-Specific Configuration Parameters

The following is an example of the configuration file fragment in the YAML format that lists prosync-specific configuration parameters:

prosync_options:
    mem_limit: 0                              # 0 = auto-detect optimal memory usage
    export_batch_size: 10000000
    max_export_batch_size: 100000000
    process_batch_size: 10000
    batch_save_after_timeout: 5m0s
    import_batch_size: 1000000
    use_online_logs_unsafe: false
    validate_log_sequence: true
    lob_write_size: 30000
    operation_count_for_external_storage: 5000
    transfer_id: ""                           # REQUIRED — no default, must be a UUID (e.g. d87708a4-c35e-4379-8845-d173683e5385)
    readers: 11
    use_failover_slots: false                 # Postgres Pro/PostgreSQL 17+ source only
    use_replica_auto_sync_slots: false
    postgres_slot_advance_interval: 5s
    loaders: 1
    truncate_process: false
    get_replication_message_timeout: 60s
    dump_mode: false
    disable_constraint_checks: false
    conflict_resolve_strategy: "nothing"      # "nothing" | "update" | "fail"
    statistic_interval: 60s

For how to set values for time configuration parameters, refer to Setting Time Values.

The following table explains prosync-specific configuration parameters:

Table 1. prosync Configuration Parameters
Name Description Default Value Example

prosync_options

prosync-specific parameters

prosync_options.export_batch_size

Batch size for prosync reading from Oracle LogMiner

prosync_options.max_export_batch_size

Maximum size to which the batch size can be increased when reading. If the maximum size is reached, prosync terminates with an error. This can happen if there is an open transaction that would not close. The user must resolve this issue.

prosync_options.process_batch_size

Batch size for processing a transaction. This parameter is for internal tuning of the application.

10000

prosync_options.batch_save_after_timeout

Time interval after which a batch will be written to the destination DB if its size is still less than max_export_batch_size. The value of zero disables time-based flush to the destination DB.

5s

5m

prosync_options.import_batch_size

Batch size for inserting data. Zero value means that the data will be inserted as new data occurs.

prosync_options.prefetch_rows

Deprecated. Number of rows that the driver retrieves from the databases at a time.

prosync_options.use_online_logs_unsafe

Read the changes from archive and online redo logs. The flag enables getting the changes as soon as they occur in online logs. Not recommended to use for reliability. Because of how Oracle writes logs, some operations can be missed.

false

prosync_options.oracle_logminer_downstream

Specifies the parameters of a writable downstream Oracle mining database. If this parameter is specified, prosync starts LogMiner on the mining database instead of the source database, and archived redo logs are mined there. The source.dsn configuration parameter can point to a read-only replica, such as an Oracle standby database, from which prosync reads metadata and discovers archived redo logs. This parameter cannot be used together with prosync_options.use_online_logs_unsafe. Only a single redo thread is supported: an Oracle Real Application Clusters (RAC) source cannot be used.

prosync_options.oracle_logminer_downstream.miner_dsn

DSN of the writable Oracle mining database on which DBMS_LOGMNR is run. The mining database must be open in the READ WRITE mode. This configuration parameter is required when prosync_options.oracle_logminer_downstream is specified.

prosync_options.oracle_logminer_downstream.archive_path_template

Template of the full path to archived redo logs that are passed to the DBMS_LOGMNR.ADD_LOGFILE procedure on the mining database. The value must match the TEMPLATE attribute of the LOG_ARCHIVE_DEST_n initialization parameter on the database that ships redo logs to the mining database. The template must contain all of the following Oracle directives: %t — THREAD#, %s — SEQUENCE#, %r — RESETLOGS_ID.

/u01/oradata/db19c/db19c_arch_%t_%s_%r.arc

prosync_options.oracle_logminer_downstream.archive_log_wait_timeout

How long prosync waits for an archived redo log to appear on the mining database. If the log does not become available within this time, prosync terminates with an error. The value of zero disables the timeout.

0

5m

prosync_options.validate_log_sequence

Validate a sequence of log files. If a log file is missing, prosync terminates with an error. If losing some data is OK, set this parameter to false.

true

prosync_options.lob_write_size

Maximum number of bytes to write at a time when writing LOBs

prosync_options.operation_count_for_external_storage

Number of operations in one transaction that causes writing of intermediate data to disk

prosync_options.transfer_id

Data transfer identifier. Used to create names of slots for replication and publications. This parameter is required.

d87708a4-c35e-4379-8845-d173683e5385

prosync_options.custom_pub_name

Custom name of the publication that prosync creates in the source database. If the value is not specified, prosync generates the name automatically. The specified name is used as is by the prosync init, prosync run, and prosync complete commands. The name must be a UTF-8 string without null characters and must not exceed 63 bytes. For details, refer to Custom Names of the Replication Slot and the Publication.

prosync_options.custom_slot_name

Custom name of the replication slot that prosync creates in the source database. If the value is not specified, prosync generates the name automatically. The specified name is used as is by the prosync init, prosync run, and prosync complete commands. The name must contain only lowercase Latin letters, digits, and underscores and must not exceed 63 bytes. For details, refer to Custom Names of the Replication Slot and the Publication.

prosync_options.null_char_replace

String to replace the null character, that is, the symbol with the zero code. This is a global setting, which can be overridden for each column with the value of tasks.transform.column_name.null_char_replace.

nil, but for the Oracle source and PostgreSQL/Postgres Pro destination:

null_char_replace:
  replace: ""
  destination_types: ["varchar", "char", "bpchar",
  "text", "json", "jsonb", "xml"]

prosync_options.null_char_replace.replace

Character or string to replace \0x0000. If not specified, no replacement will be done.

nil

replace: "\n"

prosync_options.null_char_replace.destination_types

Specifies the types in the destination database to replace null characters for. Character or string to replace \0x0000. If not specified, no replacement will be done.

[]

destination_types: ["varchar", "char",
"text", "json", "jsonb", "xml"]

prosync_options.conflict_resolve_strategy

Resolution strategy for primary key conflicts when inserting rows in the destination database (Postgres Pro/PostgreSQL or Postgres Pro Shardman). Possible values:

  • nothing: the conflicting row is ignored without an error:

    ON CONFLICT DO NOTHING
  • update: the conflicting row is updated from the source:

    ON CONFLICT (primary key) DO UPDATE

    If this is not a primary key conflict, the replication completes with an error.

  • fail: rows are inserted in the destination DB without the ON CONFLICT clause, and when the conflict occurs, an error is returned.

nothing

prosync_options.statistic_interval

How often utility operation statistics are written to the log. This parameter is used when the --service option is specified. It must be greater than or equal to 1s.

60s

prosync_options.readers

Number of readers from LogMiner. If set to a positive value, the setting of use_online_logs_unsafe is ignored.

0 — single-node slow reading, which is, however, compatible with use_online_logs_unsafe

prosync_options.use_failover_slots

Whether to use failover replication slots. It is applicable only to the PostgreSQL/Postgres Pro 17 or higher source. The prosync_options.use_failover_slots`and `prosync_options.use_replica_auto_sync_slots parameters are mutually exclusive. If one of them is set to true, the other one must be set to false. When using prosync_options.use_failover_slots, you must set the sync_replication_slots and hot_standby_feedback DBMS configuration parameters to on. This is required for correct synchronization of replication slots used by prosync.

false

prosync_options.use_replica_auto_sync_slots

Enables prosync logic for propagation of replication slots. Use if you need failover replication slots on the cluster, but have PostgreSQL/Postgres Pro lower than 17 and/or if you need to read from a replica. The prosync_options.use_replica_auto_sync_slots and prosync_options.use_failover_slots are mutually exclusive. If one of them is set to true, the other one must be set to false.

false

prosync_options.postgres_slot_advance_interval

How often a slot will be moved on the whole cluster if prosync_options.use_replica_auto_sync_slots is enabled. Must be greater than 100 milliseconds.

5s

500ms

prosync_options.postgres_timeout_waiting_no_operations

The time to wait for new operations in the slot. After this timeframe elapses, prosync gets the current LSN from the primary for the subsequent slot advancement. The value must be greater than 100 milliseconds.

10 s

500ms

prosync_options.postgres_timeout_checking_no_operations

The time to check for new operations in the slot, counted from the moment the LSN is obtained from the primary. If no new operations appear, prosync advances the slot to the obtained LSN. The value must be greater than 100 milliseconds.

2 s

500ms

prosync_options.loaders

Number of workers that write to the destination. If not specified or equals zero, one worker is used. When the value is greater than 1, operations performed in the source DB in one transaction can be split into separate transactions, which can cause a foreign key violation. If the destination DB contains constraints, use one thread to write to it.

0

prosync_options.truncate_process

Whether to process the truncate operations. If true, truncate operations will be processed for the destination table in the destination DB.

false

prosync_options.postgres_consumer_wait_timeout

The time to wait for passing an operation for writing to the destination database. After this timeframe elapses, prosync sends the PostgreSQL/Postgres Pro source a replication status message confirming that the connection is active and retries passing the operation. The value must be greater than 100 milliseconds and less than the wal_sender_timeout parameter of the source database, for example, 500ms with wal_sender_timeout = 2s. For details, refer to Maintaining the Replication Connection.

10 s

500ms

prosync_options.get_replication_message_timeout

Timeout for receiving messages from the PostgreSQL/Postgres Pro source DB. Must be greater than or equal to wal_sender_timeout.

60s

prosync_options.dump_mode

Dump mode. If enabled, operations are saved to a dump table rather than performed.

false

prosync_options.disable_constraint_checks

Turns off checking of constraints and user triggers when a batch is written to the Postgres Pro/PostgreSQL destination database. To implement this, the following statement is used inside the loader transaction:

SET LOCAL session_replication_role = replica

It requires a special setting of the destination database. When this parameter is enabled, the destination database can temporarily be inconsistent.

false

prosync_options.use_origin

Specifies the parameters of using replication origins. This is useful for the bidirectional (primary-primary) replication between two PostgreSQL/Postgres Pro databases. This functionality allows avoiding replication loops of the same changes between the replication nodes (refer to Running prosync in the Primary-Primary Replication Mode for details). Requires PostgreSQL/Postgres Pro 16 or higher.

use_origin:
  read_origin: "none"
  write_origin: "prosync_1"

prosync_options.use_origin.read_origin

Changes read from the source.

Possible values:

  • any: Changes are read regardless of their origin.

  • none: Only the changes that have no origin are read, that is, the changes made locally on the source. The changes applied by another replication node are skipped.

This parameter can be specified only if the source.driver_name configuration parameter is set to postgres.

any or not specified

prosync_options.use_origin.write_origin

Name of the replication origin used to tag changes written to the destination database. Specified together with prosync_options.use_origin when changes written to the destination must be tagged with an origin. During the prosync init operation, one origin with this name is created on the destination database. If prosync_options.loaders is greater than 1, one origin per worker is created instead, named write_origin_worker_0, write_origin_worker_1, and so on. The prosync complete operation deletes the created origins.

This parameter can be specified only if the destination.driver_name configuration parameter is set to postgres.

prosync_1

prosync_options.ha_cluster

Specifies the parameters of the high-availability mode. These parameters take effect when prosync is run with the --ha option (refer to Running prosync in the High-Availability Mode for details).

prosync_options.ha_cluster.cluster

Cluster parameters

prosync_options.ha_cluster.cluster.heartbeat_max_errors

Maximum number of consecutive heartbeat errors. Upon reaching this number, the instance is considered unable to connect to the supporting database and has to switch to the reserve mode.

5

prosync_options.ha_cluster.cluster.heartbeat_period

Interval between heartbeats

5s

prosync_options.ha_cluster.cluster.complete_timeout

Maximum time for the automatic complete operation when a critical error occurs.

3m

prosync_options.ha_cluster.source_reconnect

Reconnection parameters for the source database

prosync_options.ha_cluster.destination_reconnect

Reconnection parameters for the destination database

prosync_options.ha_cluster.storage_reconnect

Reconnection parameters for the supporting database specified by the storage configuration parameter

prosync_options.ha_cluster.monitor_retries

Parameters for restarting the transfer threads. It is strongly recommended that max_retries be left equal to 0.

prosync_options.ha_cluster.<section>

Common parameters for various sections of prosync_options.ha_cluster. The <section> attribute is one of source_reconnect, destination_reconnect, storage_reconnect, or monitor_retries.

prosync_options.ha_cluster.<section>.max_retries

Maximum number of retry attempts. The value of zero means the attempts are unlimited.

0 for monitor_retries, 3 for other parameters

prosync_options.ha_cluster.<section>.initial_delay

Minimum delay before a new attempt

5s, 1s for destination_reconnect

prosync_options.ha_cluster.<section>.max_delay

Maximum delay before a new attempt

25s, 5s for destination_reconnect

prosync_options.ha_cluster.<section>.random_factor

Randomization of the delay growth

0.5

prosync_options.ha_cluster.<section>.delay_multiplicator

Multiplier of the delay growth

1.5

prosync_options.ha_cluster.<section>.query_timeout

Maximum query time

2.5s, 1.25s for storage_reconnect

logging

Logging parameters. If this section is not specified, logs are written to stderr in the json format with the info level.

logging.level

Logging level. Possible values: debug, info, warn, error.

info

logging.format

Log format. Possible values: json, text.

json

logging.stderr

Whether to also write logs to stderr.

true

logging.file

Parameters for writing logs to a file. If this group of parameters is not specified, logs are written only to stderr.

logging.file.path

Path to the log file.

/var/log/prosync/prosync.log

logging.file.rotation

Parameters for log file rotation. If this group of parameters is not specified, the log file is written without rotation.

logging.file.rotation.max_size_mb

Maximum size of the log file in megabytes, after which it is rotated.

100

logging.file.rotation.max_backups

Maximum number of old log files to keep. The value of zero means old log files are not removed.

0

logging.file.rotation.max_age_days

Maximum age of old log files in days, after which they are removed. The value of zero means old log files are not removed based on their age.

0

logging.file.rotation.compress

Whether to compress rotated log files.

false

logging.file.rotation.handle_hup

Whether to rotate log files when the prosync process receives the SIGHUP signal. When set to the default false, the process terminates on SIGHUP without rotating the log file.

false