Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

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
Situation Awareness
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
On this page

Residual File Management Functions

Updated on 2024-12-19 GMT+08:00

Procedure

  1. Call the pgxc_get_residualfiles() function to obtain the name of the database that has residual files.
  2. Go to the databases where residual files exist and call the pgxc_verify_residualfiles() function to verify the residual files recorded in the current database.
  3. Call the pgxc_rm_residualfiles() function to delete all the verified residual files.
NOTE:

The pgxc residual file management function only operates on the CN and the current primary DN, and does not verify or clear residual files on the standby DN. Therefore, after the primary DN is cleared, you need to clear residual files on the standby DN or build the standby DN in a timely manner. This prevents residual files on the standby DN from being copied back to the primary DN due to incremental build after a primary/standby switchover.

Examples

The following example uses two user-created databases, db1 and db2.

  1. Run the following command to obtain all residual file records of the cluster on the CNs:
    1
    db1=# select * from pgxc_get_residualfiles() order by 4, 6; -- order by is optional.
    

    In the current cluster:

    • Residual file records exist in the db1 and db2 databases on the dn_6001_6002 node (active node instance).
    • Residual files are displayed in the residualfile column.
    • The filepath column lists the files that record residual files. These files are stored in the pg_residualfiles directory under the instance data directory.
  2. Call the pgxc_verify_residualfiles() function to verify the db1 database.
    1
    db1=# SELECT * FROM pgxc_verify_residualfiles();
    

    Verification functions are at the database level. Therefore, when a verification function is called in the db1 database, it only verifies residual files in db1.

    You can call the get function again to check whether the verification is complete.

    1
    db1=# SELECT * FROM pgxc_get_residualfiles() order by 4, 6;
    

    As shown in the preceding figure, the residual files in the db1 database have been verified, and the residual files in the db2 database are not verified.

  3. Call the pgxc_rm_residualfiles() function to delete residual files.
    1
    db1=# SELECT * FROM pgxc_rm_residualfiles();
    

  4. Call the pgxc_get_residualfiles() function again to check the deletion result.

    The result shows that the residual files in the db1 database are deleted (isdeleted is marked as t) and the residual files in the db2 database are not deleted.

    In addition, nine query results are displayed. Compared with the previous query results, a record for the residual file ending with 9438 is missing. This is because the record file that records the residual file ending with 9438 contains only one record, which is deleted in step 3. If all residual files in a record file are deleted, the record file is also deleted. Deleted files are backed up in the pg_residualfiles/backup directory.

  5. To delete files from the db2 database, you need to call the verify function in the db2 database and then call the rm function.
    1. Go to the db2 database and call the verification function.

      Query the verification result:

    2. Call the deletion function:

    3. Query the deletion result:

      All residual files recorded in the record file whose name ends with 8342 have been deleted, so the record file is deleted and backed up in the backup directory. As a result, no records are found.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback