Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Standby Server

Updated on 2024-08-20 GMT+08:00

hot_standby

Parameter description: Specifies whether to allow connections and queries on a standby node during its recovery.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

NOTICE:
  • If this parameter is set to on, wal_level must be set to hot_standby or a higher level. Otherwise, the database startup fails.
  • In an HA system, hot_standby cannot be set to off, because this setting can affect other features of the HA system.
  • If the hot_standby parameter was disabled and the wal_level parameter was set to a value smaller than that of hot_standby, perform the following operations to ensure that the logs to be replayed on the standby node can be queried on the standby node before enabling the hot_standby parameter again:
    1. Change the value of wal_level of the primary and standby nodes to the value of hot_standby or a higher value, and restart the instances for the change to take effect.
    2. Perform the checkpoint operation on the primary node and query the pg_stat_get_wal_senders() function to ensure that the value of receiver_replay_location of each standby node is the same as that of sender_flush_location of the primary node. Ensure that the value adjustment of wal_level is synchronized to the standby nodes and takes effect, and the standby nodes do not need to replay low-level logs.
    3. Set the hot_standby parameter of the primary and standby nodes to on, and restart the instances for the setting to take effect.
  • If the read on standby function is enabled, conflicts between replay and query on the standby node may cause the query to cancel. The error information is as follows:
    • ERROR: canceling statement due to conflict with recovery
    • ERROR: terminating connection due to conflict with recovery
  • During the standby node read in serial and parallel replay modes, when the primary node rebuilds indexes online, an error may be reported when the standby node is read. Try again later. The error information is as follows:
    • could not open relation with OID xxx during recovery delete object, please try again later
    • Catalog is missing xxx attribute(s) for relid xxx
    • cache lookup failed for index xxx, refilenode:xxx, name:"xxx"
    • could not find pg_class entry for xxx
  • During the standby node read in the case of ultimate RTO, the VM with small memory configuration may report an error indicating insufficient memory. You can enable the GUC parameter exrto_standby_read_opt (enabled by default) to effectively reduce the memory and I/O overhead.
  • Use sysbench to test the read performance of the standby node in typical scenarios: The primary node executes 100 concurrent update services. The primary and standby nodes both execute 200 concurrent read services at the same time. When the I/O and CPU are not limited, the read performance of the standby node in serial replay mode is not lower than 80% of that of the primary node, and the read performance of the standby node in ultimate RTO deteriorates by no more than 10% compared with that of the standby node in serial replay mode.

Value range: Boolean

  • on indicates that connections and queries are allowed on the standby node during the recovery.
  • off indicates that connections and queries are not allowed on the standby node during the recovery.

Default value: on

max_standby_archive_delay

Parameter description: Specifies the wait period before queries on a standby node are canceled when the queries conflict with WAL processing and archiving in hot standby mode. In the current version, the setting does not take effect and is controlled by the max_standby_streaming_delay parameter.

Parameter type: integer

Unit: millisecond

Value range: –1 to 2147483647

NOTE:

–1 indicates that the standby node waits until the conflicting queries are complete.

Default value: 3000ms (that is, 3s)

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

max_standby_streaming_delay

Parameter description: Specifies the wait period before queries on the standby node are canceled when the queries conflict with WAL data receiving through streaming replication in hot standby mode. If this parameter is set to a large value or the service load is heavy, an error may be reported for waiting for transaction replay and flushing to disks.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

NOTICE:

–1 indicates that the standby node waits until the conflicting queries are complete. In the scenario where serial or parallel replay is enabled, if the system detects that the query thread and replayer thread are in the deadlock state, the system still cancels the query to prevent replay blocking.

Value range: an integer ranging from –1 to INT_MAX. The unit is ms.

Default value: 3000ms (that is, 3s)

wal_receiver_status_interval

Parameter description: Specifies the maximum interval for notifying the primary node of the WAL receiver status.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to INT_MAX/1000. The unit is s.

Default value: 5s

NOTICE:

If this parameter is set to 0, the standby node does not send information, such as the log receiving location, to the primary node. As a result, the transaction commit on the primary node may be blocked, and the switchover may fail. In normal service scenarios, you are advised not to set this parameter to 0.

hot_standby_feedback

Parameter description: Specifies whether the ID of the oldest transaction active on standby nodes will be sent to the primary node, preventing a query conflict.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on indicates that the ID of the oldest transaction active on standby nodes will be sent to the primary node.
  • off indicates that the ID of the oldest transaction active on standby nodes will not be sent to the primary node.

Default value: off

NOTICE:

If this parameter is set to on, VACUUM on the primary node will not clean up tuples modified in transactions later than the oldest transaction active on standby nodes.

Therefore, the performance of the primary node will be affected. If replay conflicts with query on the standby node and a query error is reported, you are advised to increase the value of max_standby_streaming_delay.

wal_receiver_timeout

Parameter description: Specifies the maximum wait period for a standby node to receive data from the primary node.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to INT_MAX. The unit is ms.

Default value: 6s (that is, 6000 ms)

wal_receiver_connect_timeout

Parameter description: Specifies the timeout interval for a standby node to connect to the primary node.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to INT_MAX/1000. The unit is s.

Default value: 2s

wal_receiver_connect_retries

Parameter description: Specifies the maximum attempts that a standby node connects to the primary node.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 1 to INT_MAX

Default value: 1

wal_receiver_buffer_size

Parameter description: Specifies the memory buffer size for the standby nodes to store the received Xlog files.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 4096 to 1047552. The unit is KB.

Default value: 64MB (65536 KB)

primary_slotname

Parameter description: Specifies the slot name of the primary node corresponding to a standby node. This parameter is used for the mechanisms to verify the primary-standby relationship and delete WALs.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string

Default value: an empty string

max_standby_base_page_size

Parameter description: Specifies the maximum storage space of base page files on the standby node after the ultimate RTO function is enabled.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a long integer ranging from 1048576 to 562949953421311. The unit is KB.

Default value: 268435456‬ (256 GB)

max_standby_lsn_info_size

Parameter description: Specifies the maximum size of LSN info files on the standby node after the ultimate RTO function is enabled.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a long integer ranging from 1048576 to 562949953421311. The unit is KB.

Default value: 268435456‬ (256 GB)

max_keep_csn_info_size

Parameter description: Specifies the maximum size of CSN info linked lists allowed by each DN on the standby node after the ultimate RTO function is enabled.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a long integer ranging from 16384 to 131072. The unit is KB.

Default value: 16384 (16 MB)

base_page_saved_interval

Parameter description: Specifies the interval for generating base pages on the standby node after the ultimate RTO function is enabled. For the same page, a base page is generated each time the value of this parameter is replayed.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 5 to 2000.

Default value: 400

standby_force_recycle_ratio

Parameter description: Specifies the percentage of files read by the standby node to trigger forcible recycling after the ultimate RTO function is enabled. When the total size of base page files exceeds the value of max_standby_base_page_size x standby_force_recycle_ratio or the total size of LSN info files exceeds the value of max_standby_lsn_info_size x standby_force_recycle_ratio, forcible recycling is triggered and some queries are canceled. When the value of standby_force_recycle_ratio is 0, forcible recycling is not started, and the setting of max_standby_base_page_size and max_standby_lsn_info_size does not take effect.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a double-precision floating-point number ranging from 0.0 to 1.0

Default value: 0.8

standby_recycle_interval

Parameter description: Specifies the interval for the standby node to recycle read files after the ultimate RTO function is enabled. The thread for recycling read resources on the standby node attempts to clear read files on the standby node at the interval specified by this parameter.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to 86400‬. The unit is s.

Default value: 10

standby_max_query_time

Parameter description: Specifies the maximum query time supported on the standby node after the ultimate RTO function is enabled. If the query time exceeds the value of this parameter, the query will be canceled. Note: The time when the query is canceled is affected by the interval parameter standby_recycle_interval of the recycling thread and the time when the snapshot is obtained. Therefore, the actual execution time of the query on the standby node must be greater than the value of this parameter.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to 86400‬. The unit is s.

Default value: 600

exrto_standby_read_opt

Parameter description: Specifies whether to support read optimization of the standby node with ultimate RTO. This parameter is enabled by default. This parameter is not synchronized between the primary and standby nodes.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: Boolean. on indicates that the optimization is enabled, and off indicates that the optimization is disabled.

Default value: on

walrcv_writer_crc_check_level

Parameter description: Specifies whether to enable Xlog verification on the standby node in the primary/standby databases in the streaming DR scenario. By default, the parameter is enabled only in the DR database.

Parameter type: integer

Unit: none

Value range: 0 to 3
  • 0: The verification is disabled.
  • 1: The verification in the DR database takes effect.
  • 2: The verification on the standby node of the primary database takes effect.
  • 3: Standby nodes in the primary database and nodes in the DR database take effect.

Default value: 1

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback