A cluster service failure recovery method, device, medium and product

Through dynamic link libraries and snapshot technology, fault points in high-performance computing clusters are intercepted to realize automatic job recovery, solve the problem of resource waste and time extension caused by faults, and improve the stability and recovery efficiency of the system.

CN118467256BActive Publication Date: 2024-09-06JINAN INSPUR DATA TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410939698.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-15
Publication Date
2024-09-06
Estimated Expiration
2044-07-15

AI Technical Summary

Technical Problem

In high-performance computing clusters, when a failure occurs, jobs need to be executed from the beginning, resulting in a waste of resources and extended running time, affecting stability.

Method used

Intercept the request operation information of the target process through the dynamic link library, record the virtual path, and use snapshot and sub-volume technology to save and restore the state to achieve automatic recovery from the point of failure.

Benefits of technology

It improves fault recovery efficiency, reduces job running time, enhances system stability and reliability, and ensures job continuity and resource utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118467256B
    Figure CN118467256B
Patent Text Reader

Abstract

The present invention discloses a business fault recovery method, device, medium and product for a cluster, and relates to the field of computer technology. Before conventional file access, the request operation information of the target process is intercepted by creating a dynamic link library, and the corresponding virtual path is recorded. The file access operation of the user job process is extracted from the actual file system, so that the user job is decoupled from the underlying file system, and the flexibility and recoverability of the system are enhanced. Through the subvolume and snapshot functions, an isolated file environment is created for each job, and the state is saved and restored in real time through the snapshot, thereby improving the security and recovery efficiency of the data. Based on the mapping relationship between the virtual path and the real path, the virtual path and the snapshot path respectively, the user can use the virtual path all the time and can perform the conversion between the real path and the snapshot path without knowing it, so as to realize that when the target process is abnormal, the user automatically triggers the fault recovery without feeling to save resources.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a cluster service failure recovery method, device, medium and product. Background Art

[0002] In an actual high-performance computing cluster, it takes a long time for a job to run, which may cause hardware or software failures to affect the job progress. Fault recovery of high-performance computing clusters ensures cluster stability and continuity.

[0003] In the fault recovery of a conventional high-performance computing cluster, if the fault point is in the middle of a job, the job will be executed from the beginning, causing the original job process that was not at fault to be restarted, resulting in a waste of resources. At the same time, it will also cause the job running time to be prolonged, affecting the stability of the entire job operation.

[0004] Therefore, how to improve the fault recovery efficiency of high performance computing clusters is an urgent problem that technical personnel in this field need to solve. Summary of the invention

[0005] The purpose of the present invention is to provide a cluster business fault recovery method, device, medium and product to solve the technical problem that when the fault point is in the middle of the job operation, the job will be executed from the beginning, causing the original job process that has not failed to start execution again, resulting in resource waste and prolonged operation time.

[0006] In order to solve the above technical problems, the present invention provides a cluster service failure recovery method, which is applied to cluster nodes and includes:

[0007] Acquire a target process corresponding to a cluster node; and call a request operation function corresponding to a pre-established dynamic link library according to the target process to determine request operation information of the target process to be intercepted by the dynamic link library;

[0008] Determine a virtual path of the target file according to the request operation information and the target file corresponding to the target process;

[0009] Backing up the target file corresponding to the target process in advance to the checkpoint file of the target process in a snapshot manner to obtain target sub-files corresponding to different time nodes, the target file and the snapshot paths corresponding to the target sub-files;

[0010] Obtain the real path of the target file in the target process; and determine the failure point of the target business corresponding to the target process after the dynamic link library intercepts the access and the failure recovery file corresponding to the target sub-file according to the relationship between the virtual path and the real path, and the relationship between the virtual path and the snapshot path, so as to facilitate recovery processing.

[0011] On the one hand, the process of establishing the dynamic link library includes:

[0012] Obtaining environment variables corresponding to the target process;

[0013] The environment variable is set in the program before accessing the target file corresponding to the target process to establish the dynamic link library; wherein the dynamic link library takes precedence over the program language standard library to force loading the target file corresponding to the target process before the program is started.

[0014] On the other hand, the request operation information intercepted by the dynamic link library of the target process includes at least one or more request information corresponding to an open function, a write function and a read function.

[0015] On the other hand, when the request operation information of the target process to be intercepted by the dynamic link library is the open function, the process of intercepting the access by the dynamic link library includes:

[0016] Pre-establishing a first file path corresponding to a target file of the request operation information corresponding to the open function;

[0017] Using the first file path as the first virtual path of the target file;

[0018] Obtain a first real path corresponding to a first file of request operation information corresponding to the open function of a programming language standard library;

[0019] Establishing a mapping relationship between the first virtual path and the first real path in advance;

[0020] Converting the first virtual path of the open function based on the dynamic link library into the first real path to call the open function of the program language standard library;

[0021] The first virtual file descriptor of the dynamic link library is recorded according to the first real file descriptor of the open function of the program language standard library to determine that the dynamic link library intercepts the access successfully.

[0022] On the other hand, when the request operation information of the target process to be intercepted by the dynamic link library is the read function or the write function, the process of intercepting the access by the dynamic link library includes:

[0023] Based on the acquisition of the first virtual file descriptor, acquiring a second virtual path of the target file corresponding to the read function or the write function;

[0024] Determine a corresponding second virtual file descriptor according to the second virtual path;

[0025] Determine a second real file descriptor corresponding to the read function or the write function according to a mapping relationship among the second virtual file descriptor, the first virtual file descriptor and the first real file descriptor;

[0026] The read function or the write function of the programming language standard library is called according to the second real file descriptor to determine that the dynamic link library intercepts the access successfully.

[0027] On the other hand, backing up the target file corresponding to the target process in advance to the checkpoint file of the target process in a snapshot manner to obtain target sub-files corresponding to different time nodes, the target file and the snapshot paths corresponding to the target sub-files, including:

[0028] Pre-create a corresponding target subvolume based on the target process in the checkpoint file;

[0029] Backing up the target file corresponding to the target process to the target subvolume in a snapshot manner;

[0030] Pre-creating target sub-files corresponding to target files corresponding to different time nodes in the target sub-volume;

[0031] The storage paths of the target sub-volume and the target sub-file are used as the snapshot path.

[0032] On the other hand, the checkpoint operation process of the checkpoint file includes:

[0033] Adding a scheduled task in advance when the target process is not started, so as to create the checkpoint file when the target process is started;

[0034] A checkpoint operation of the checkpoint file is performed on the target process according to a first preset time interval, so that the target process can be restored to the checkpoint file when a failure occurs.

[0035] On the other hand, it also includes:

[0036] When the target process accesses other subvolume directories outside the target subvolume and the target process performs a read operation on other subvolume directories outside the target subvolume, the files in other subvolume directories outside the target subvolume are not backed up in snapshot mode.

[0037] On the other hand, the process of creating the checkpoint file includes:

[0038] Call monitoring function;

[0039] Freeze the target program of the target process according to the tracking command of the monitoring function;

[0040] Using a file system command to take a snapshot of the target subvolume of the target process to save the snapshot path; and saving the snapshot path to the checkpoint file;

[0041] Obtaining a CPU image file and a memory image file in the cluster node to which the target process belongs according to the monitoring function, and writing them into the checkpoint file;

[0042] The offset of the target file is determined by a file positioning function so as to save the offset and the file descriptor into the checkpoint file to complete the creation of the checkpoint file.

[0043] On the other hand, in the cluster node to which the target process belongs, a CPU image file and a memory image file are obtained according to the monitoring function, and written into the checkpoint file, including:

[0044] Calling the monitoring function to determine the register value of the target process;

[0045] Using the register value as the CPU image file;

[0046] Injecting parasitic code into the target process through the interface information corresponding to the monitoring function;

[0047] Acquiring memory information of the target process through the parasitic code;

[0048] Saving the memory information to a corresponding disk file;

[0049] The saved disk file is used as the memory image file.

[0050] On the other hand, after creating the checkpoint file corresponding to the target process, the method further includes:

[0051] Get the checkpoint file of the previous target process;

[0052] Delete the checkpoint file of the previous target process.

[0053] On the other hand, before obtaining the target process corresponding to the cluster node, the method further includes:

[0054] Receive the job progress sent by the user;

[0055] Dispatching the job process to the cluster node;

[0056] When the parent process is running, a child process is created and the process proceeds to the step of obtaining the target process corresponding to the cluster node.

[0057] In order to solve the above technical problems, the present invention further provides a cluster service failure recovery device, comprising:

[0058] Memory for storing computer programs;

[0059] The processor is used to implement the steps of the cluster service failure recovery method as described above when executing the computer program.

[0060] In order to solve the above technical problem, the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the cluster service failure recovery method are implemented.

[0061] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the cluster service failure recovery method when executed by a processor.

[0062] The beneficial effect of the present invention is that before the conventional file access, the request operation information of the target process is intercepted by creating a dynamic link library, and the corresponding virtual path is recorded. The file access operation of the user job process is extracted from the actual file system, so that the user job is decoupled from the underlying file system, the system flexibility and recoverability are enhanced, and at the same time, the file operation of the process is controlled and redirected without modifying the original job code, so as to realize the transparent management of the process behavior. Through the subvolume and snapshot functions, an isolated file environment is created for each job, and the instant preservation and recovery of the state is realized through the snapshot, so as to improve the security and recovery efficiency of the data. Based on the mapping relationship between the virtual path and the real path, the virtual path and the snapshot path respectively corresponding to each other, the user can use the virtual path all the time and can perform the conversion between the real path and the snapshot path without knowing it, so as to realize that when the target process is abnormal, the user can automatically trigger the fault recovery without feeling, so that the fault recovery file corresponding to the recovery job process is restored to the end of the target process, so as to save resources. In addition, the recovery processing of the fault recovery file is performed on the basis of the fault point, so as to reduce the time of the job operation, improve the fault recovery efficiency, and ensure the stability of the whole job operation.

[0063] Secondly, the dynamic link library intercepts the specific request information of the target process's request operation information, and implements the overwriting of open, read, write and other functions in the glibc library, so as to achieve the purpose of hijacking the open, read, write and other function calls in the libc library. Based on the dynamic link library interception access process determined by the open function, the user job and the underlying file system structure are implemented based on the virtual path and virtual file descriptor. The file access operation and the setting of the virtual path can access the real file, so that it can be extracted from the actual file system. Subvolumes are created to provide an isolated file system environment for each job, which enhances the security and isolation between jobs. At the same time, backup operations are performed, and the snapshot and data integrity characteristics of the btrfs file system are used to ensure the consistency and integrity of data during the fault recovery process. Automated scheduled checkpoint operations and fast recovery mechanisms periodically save the job status, reduce computing interruptions and resource waste caused by faults, enhance the stability of the system, and ensure the continuity and reliability of long-term running jobs. Obtain memory image files and CPU image files to ensure that they can be quickly recovered from the last saved state when a fault occurs. Checkpoint files are created to facilitate process-level fault recovery technology. This allows for periodic saving of job status and improves system stability and reliability.

[0064] In addition, the present invention also provides a cluster service failure recovery device, medium and product, which have the same beneficial effects as the above-mentioned cluster service failure recovery method. BRIEF DESCRIPTION OF THE DRAWINGS

[0065] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0066] Figure 1 A flow chart of a cluster service failure recovery method provided by an embodiment of the present invention;

[0067] Figure 2 A schematic diagram of a business failure recovery scenario provided by an embodiment of the present invention;

[0068] Figure 3 A schematic diagram of a file system failure recovery scenario provided by an embodiment of the present invention;

[0069] Figure 4 A structural diagram of a cluster service failure recovery device provided by an embodiment of the present invention;

[0070] Figure 5A structural diagram of a cluster service failure recovery device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0072] The core of the present invention is to provide a cluster business fault recovery method, device, medium and product to solve the technical problem that when the fault point occurs in the middle of the job operation, the job will be executed from the beginning, causing the original job process that has not failed to start executing again, resulting in resource waste and prolonged operation time.

[0073] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0074] High-performance computing plays a broad and important role in many industries, including life sciences, manufacturing simulation computer-aided engineering design (CAE), chemical industry, aerospace, materials, meteorology, etc. In these fields, a large amount of calculations are generally involved, and the computing tasks are required to be completed within a certain period of time. A single general server node cannot meet the requirements. Generally, multiple high-performance servers are used, interconnected by high-speed networks, to form a high-performance computing cluster to process large amounts of data in parallel at extremely high speeds.

[0075] High-performance computing cluster job scheduling systems, such as the open source Simple Linux Utility for Resource Management (Slurm), are highly scalable and fault-tolerant cluster managers and job scheduling systems for large clusters of compute nodes, and are widely used by supercomputers and computing clusters around the world. The system maintains a queue of pending user job scripts and manages the overall resource utilization of the job. It manages the available compute node resources in a shared or non-shared manner for users to execute jobs. The system allocates resources appropriately to the job queue and monitors the job to completion.

[0076] Jobs running in a high-performance computing (HPC) cluster may need to run for a long time. During this process, the running job process may end abnormally due to various reasons such as hardware failure (such as central processing unit (CPU) failure, power failure, etc.) or software failure (such as operating system or application software exception). If the job is executed from the beginning after the failure, it will cause a waste of resources. In addition, some scenarios have high requirements for timeliness (such as weather forecasting, which requires predicting future trends every day). If the time delay caused by the execution of the job from the beginning after the failure is tolerated, there is an urgent need for a technology that can quickly recover the process after a failure and continue to run from the state before the failure. However, the fault recovery of the process also faces many challenges. First, the process may directly use various heterogeneous external devices (such as graphics processing unit (GPU), data processing unit (DPU), field programmable gate array (FPGA) card, etc.) during operation. The status of these devices is difficult to recover during fault recovery. Second, the process will also read and write files during operation, but the path and content of the file may have changed during fault recovery, which will obviously affect the file operation after the process is restored. The business fault recovery method of the cluster provided by the present invention can solve the above technical problems.

[0077] Figure 1 A flow chart of a cluster service failure recovery method provided by an embodiment of the present invention, such as Figure 1 As shown, it is applied to cluster nodes and includes:

[0078] S11: Obtain the target process corresponding to the cluster node; and call the request operation function corresponding to the pre-established dynamic link library according to the target process to determine the request operation information of the target process to be intercepted by the dynamic link library;

[0079] S12: Determine a virtual path of the target file according to the request operation information and the target file corresponding to the target process;

[0080] S13: backing up the target file corresponding to the target process in advance to the checkpoint file of the target process in a snapshot manner to obtain target sub-files corresponding to different time nodes, and snapshot paths corresponding to the target file and the target sub-file;

[0081] S14: Obtain the real path of the target file in the target process; and determine the fault point of the target business corresponding to the target process after the dynamic link library intercepts the access and the fault recovery file corresponding to the target sub-file according to the relationship between the virtual path and the real path, and the relationship between the virtual path and the snapshot path, so as to facilitate recovery processing.

[0082] Specifically, the number of cluster nodes in step S11 can be one or more, and the target process corresponding to the cluster node is based on the processes in each cluster node corresponding to the service failure recovery process of this embodiment, or based on each service process of each cluster node. The process here is based on the corresponding job process in the job scheduling system. In the job scheduling system, a job usually refers to a task or a group of tasks that requires computing resources (such as CPU, memory, disk space, etc.) and time to execute. A job usually consists of one or more processes, which are executed on a computing node and share resources. Jobs can be of various types, such as scientific simulation, data analysis, machine learning, etc. In the Slurm job scheduling system, after the user submits a job, Slurm will schedule the job to be executed on a suitable computing node according to the requirements of the job and the availability of system resources. Users can submit and manage jobs through Slurm command line tools (such as sbatch, srun, etc.).

[0083] According to the target process, the request operation function corresponding to the pre-established dynamic link library is called. The dynamic link library here is a library file containing codes and resources that can be used by multiple programs at the same time. In the Windows operating system, this file is very common. They allow programs to call functions and resources in the library at runtime without statically compiling these codes and resources into the program. In this dynamic link library, it prioritizes the ordinary programming language standard library (C Standard Library, libc) library loader, thereby overwriting the open function (open), read function (read) and write function (write) in the glibc library to implement the request operation information of the target process to be intercepted. The specific interception process is to set the corresponding environment variables for interception, and access based on the virtual path of the target process for access.

[0084] In some embodiments, the process of establishing a dynamic link library includes:

[0085] Get the environment variables corresponding to the target process;

[0086] The environment variable is set in the program before accessing the target file corresponding to the target process to establish a dynamic link library; wherein the dynamic link library takes precedence over the program language standard library to force loading the target file corresponding to the target process before the program starts.

[0087] It is understandable that the environment variable is the LD_PRELOAD environment variable, which is a very useful Linux environment variable. It can force the dynamic linker (ld.so) to load the specified shared library file when the program starts, thereby overwriting the original library file or adding new functions.

[0088] When the program starts, the dynamic linker will first search for the shared library file specified by the LD_PRELOAD environment variable. If found, it will load the shared library file first, and then load other library files that the program depends on. In this way, during the execution of the program, the shared library file specified by the LD_PRELOAD environment variable can be used first, rather than the system default library file. That is, the environment variable is set in the access program before accessing the target file corresponding to the target process to establish a dynamic link library. It should be noted that the dynamic link library takes precedence over the libc library in the C language to force the loading of the target file corresponding to the target process before the program starts. At this time, when the user job process calls the dynamic link library, the function of the libc library is called by default, so as to achieve the purpose of hijacking the function call of the libc library.

[0089] The request operation information in this embodiment is mainly based on the operation information corresponding to the request operation function such as the open function, the write function and the read function. The virtual path of the target file is determined according to the request operation information and the target file corresponding to the target process. The virtual path here is the path corresponding to the target file accessed by the request operation function based on the dynamic link library.

[0090] When a virtual path accesses a file in a user process (including files in a subvolume and files that need to be accessed outside the subnet), it does not access the actual path of the file, but in the virtual file system corresponding to the dynamic link library, where the dynamic link library performs the conversion between the virtual file system path and the actual file system path. The virtual file system ensures that after checkpointing and recovery, the same virtual path can be used to access the same file, and will not be affected by changes in the subvolume mount point of the checkpoint file.

[0091] In step S13, before accessing the target file, the target file is backed up to the checkpoint file of the target process by snapshot, and the snapshot paths corresponding to the target subfile, target file and target subfile at different time nodes can be obtained. The snapshot function here is based on read-only and writable snapshots, which is helpful for data recovery. It should be noted that the snapshot method implemented in this embodiment is based on creating a subvolume, and the snapshot of the created subvolume shares data blocks with the atomic volume of the original file system until the data changes, making the snapshot very space-saving and fast to create. Data recovery is when the subvolume is damaged, and the snapshot can be used to restore the data. The snapshot path in this embodiment is based on the directory path corresponding to the storage of the target file and the target subfile obtained by snapshot method in the created checkpoint file. The order of steps S12 and S13 here is not in particular order.

[0092] In step S14, the real path of the target file in the target process is obtained, that is, the real path corresponding to the target file in the original file system. The real path for the target process here is intended to explain the real path of the target file in the actual target process.

[0093] It can be understood that there is a mapping relationship between the virtual path and the real path, and a mapping relationship between the virtual path and the snapshot path. Through the intermediate bridge method of the virtual path, the fault point of the corresponding target business under the real path can be found based on the snapshot path. Based on the fault point, the target sub-file corresponding to the fault point under the snapshot path can be obtained to obtain the corresponding fault recovery file required during fault recovery, so as to facilitate subsequent recovery processing.

[0094] A cluster service failure recovery method provided by an embodiment of the present invention is applied to a cluster node, including: obtaining a target process corresponding to the cluster node; and calling a request operation function corresponding to a pre-established dynamic link library according to the target process to determine the request operation information of the target process to be intercepted by the dynamic link library; determining the virtual path of the target file according to the request operation information and the target file corresponding to the target process; pre-backing up the target file corresponding to the target process to the checkpoint file of the target process in a snapshot manner to obtain the target sub-files corresponding to different time nodes, the target file and the snapshot path corresponding to the target sub-file; obtaining the real path of the target file in the target process; and determining the fault point of the target service corresponding to the target process after the dynamic link library intercepts the access and the fault recovery file corresponding to the target sub-file according to the relationship between the virtual path and the real path, and the relationship between the virtual path and the snapshot path, so as to facilitate the recovery process. Compared with the conventional high-performance computing cluster fault recovery, if it occurs in the middle of the job operation, the job will be re-executed, resulting in resource waste. Before the conventional access file, the present invention intercepts the request operation information of the target process by creating a dynamic link library and records the corresponding virtual path. The file access operation of the user job process is extracted from the actual file system, so that the user job is decoupled from the underlying file system, and the system flexibility and recoverability are enhanced. At the same time, the file operation of the process is controlled and redirected without modifying the original job code, realizing transparent management of the process behavior. Through the subvolume and snapshot functions, an isolated file environment is created for each job, and the state is saved and restored in real time through snapshots, which improves the security and recovery efficiency of data. Based on the mapping relationship between the virtual path and the real path, the virtual path and the snapshot path, the user can use the virtual path all the time and can switch between the real path and the snapshot path without knowing it, so that when the target process is abnormal, the user can automatically trigger the fault recovery without feeling, so that the fault recovery file corresponding to the recovery job process is restored to the end of the target process to save resources. In addition, the fault recovery file is recovered based on the fault point to reduce the time of job operation, improve the efficiency of fault recovery, and ensure the stability of the entire job operation.

[0095] In some embodiments, the request operation information of the target process to be intercepted by the dynamic link library includes at least one or more request information corresponding to an open function, a write function, and a read function.

[0096] Specifically, the libc library provides a set of functions for file operations, allowing programs to open, read, write, and close files. The open function is to open a file and return a file descriptor. The close function is to close an open file descriptor; the read function is to read data from a file, and the write function is to write data to a file. In combination with the above embodiment, the dynamic link library intercepts the libc library, and the corresponding functions are the same, so here at least one or more request information corresponding to the open function, the write function, and the read function is included.

[0097] The user process uses the open, read, write and other functions implemented in the libc library to open, read and write files on the file system. In order to hijack the user process's various operations on files on the file system, a dynamic link library (fakelibc library) is developed, and the open, read, write and other functions are also implemented in the fakelibc library.

[0098] The plug-in sets the LD_PRELOAD environment variable for the user's job process. The role of this environment variable is to define the dynamic link library that is loaded first before the program runs. By executing export LD_PRELOAD=". / fakelibc.so", the fakelibc library can be loaded first before the ordinary libc library, thereby overwriting the open, read, write and other functions in the glibc library. In this way, when these functions are called in the user's job process, the function implementation in fakelibc is called by default, achieving the purpose of hijacking the open, read, write and other function calls in the libc library.

[0099] The dynamic link library provided in this embodiment intercepts the specific request information of the target process's request operation information, thereby overwriting the open, read, write and other functions in the glibc library, so as to achieve the purpose of hijacking the open, read, write and other function calls in the libc library.

[0100] In some embodiments, when the request operation information of the target process to be intercepted by the dynamic link library is an open function, the process of the dynamic link library intercepting the access includes:

[0101] Pre-establish a first file path corresponding to a target file of the request operation information corresponding to the open function;

[0102] Using the first file path as the first virtual path of the target file;

[0103] Obtain a first real path corresponding to a first file of request operation information corresponding to an open function of a programming language standard library;

[0104] Establishing a mapping relationship between the first virtual path and the first real path in advance;

[0105] Converting a first virtual path of an open function based on a dynamic link library into a first real path to call an open function of a program language standard library;

[0106] The first virtual file descriptor of the dynamic link library is recorded according to the first real file descriptor of the open function of the program language standard library to determine that the dynamic link library intercepts the access successfully.

[0107] Specifically, the interception process corresponding to the present invention is intercepted based on the request information, that is, when the user job process calls the open function to open the file, the dynamic link library intercepts the open function call. If access is to be made, the file needs to be actually opened, and the path of the opened file is the corresponding virtual path, that is, the first file path corresponding to the target file based on the request operation information corresponding to the open function is used as the first virtual path. The dynamic link library converts the virtual path into the path of the real file system, that is, the mapping relationship between the first virtual path and the first real path is established in advance. At this time, the first virtual path needs to be converted into the first real path, and the open function of the original program language standard library (libc library) in the operating system is called to open the file. Here, the first virtual file descriptor of the dynamic link library is recorded according to the first real file descriptor of the open function of the original program language standard library (libc library), so as to determine that the dynamic link library intercepts the access successfully.

[0108] File Descriptor (File Descriptor), a file descriptor in the Linux system is an abstract indicator used to represent an open file or other input / output resource. Each open file or resource is assigned a unique non-negative integer, which is used to identify a specific file or resource in a system call.

[0109] It should be noted that the file descriptor needs to be virtualized, that is, the file descriptor used by the user process to operate the file is not the real file descriptor in the operating system, but a virtual file descriptor. For example, the open function of the libc library returns the file descriptor a (a is an integer), fakelibc converts a into a virtual file descriptor b (b is an integer), fakelibc records the correspondence between the virtual file descriptor and the real file descriptor, fakelibc returns the virtual file descriptor b to the user process, and the subsequent user process accesses the file through this virtual file descriptor.

[0110] The reason for using virtual file descriptors is that file descriptors need to be regenerated when the process is restored. The regenerated file descriptors may be different from the file descriptors held by the user process at the time of checkpoint, resulting in the user process being unable to continue to operate the file through the file descriptors at the time of checkpoint after recovery. By using the virtual file descriptors generated by fakelibc, it can be ensured that the values ​​of the virtual file descriptors used by the user process to operate the same file during checkpoinit and recovery are the same, so that the user process cannot perceive the changes in the file descriptors, allowing the user process to still access the file normally after recovery.

[0111] The present embodiment provides a process for intercepting access to a dynamic link library determined based on an open function, implements user operations and underlying file system structures based on virtual paths and virtual file descriptors, and uses file access operations and virtual path settings to access real files, thereby extracting them from the actual file system.

[0112] In some embodiments, when the request operation information of the target process to be intercepted by the dynamic link library is a read function or a write function, the process of intercepting the access by the dynamic link library includes:

[0113] Based on the first virtual file descriptor, a second virtual path of the target file corresponding to the read function or the write function is obtained;

[0114] Determine a corresponding second virtual file descriptor according to the second virtual path;

[0115] Determine a second real file descriptor corresponding to the read function or the write function according to a mapping relationship among the second virtual file descriptor, the first virtual file descriptor and the first real file descriptor;

[0116] The read function or write function of the program language standard library is called according to the second real file descriptor to determine that the dynamic link library intercepts the access successfully.

[0117] Specifically, when performing a read function or a write function, the premise is that the access has been successfully intercepted by the open function. At this time, it is necessary to obtain the second virtual path corresponding to the read function or the write function on the basis of obtaining the first virtual file descriptor, and determine the corresponding second virtual file descriptor by the second virtual path. Based on the mapping relationship between the first virtual file descriptor and the first real file descriptor, the mapping relationship between the second virtual file descriptor and the second real file descriptor can also be inferred, so as to determine the second real file descriptor corresponding to the read function or the write function based on the second virtual file descriptor, and then call the original program language standard library (libc library) through the second real file descriptor. Function or write function to determine the interception access of the dynamic link library is successful.

[0118] When the obtained virtual file descriptor executes the read / write function to read / write the file, fakelibc intercepts the read / write function call. Since the correspondence between the first virtual file descriptor and the first real file descriptor is recorded in the above embodiment, fakelibc finds the second real file descriptor corresponding to the second virtual file descriptor according to the correspondence, and then uses the second real file descriptor to call the read / write function of the original libc library of the operating system.

[0119] The present embodiment provides a process for intercepting access to a dynamic link library determined based on a read function or a write function, implements user operations and underlying file system structures based on virtual paths and virtual file descriptors, and uses file access operations and virtual path settings to access real files, thereby extracting them from the actual file system.

[0120] In some embodiments, the method further comprises:

[0121] When the first file path corresponding to the target file of the request operation information corresponding to the open function is not the first virtual path or the path of the target file corresponding to the read function or the write function is not the second virtual path, it is determined that the target process has unauthorized access to the file;

[0122] Control the dynamic link library to deny access to the target file;

[0123] Returns access failure information.

[0124] Specifically, no matter what kind of request operation information (open function, read function or write function, etc.), as long as the path of the corresponding target file is not the corresponding virtual path, it means that the current user has unauthorized access to the file. In order to stop the loss in time, it is necessary to deny access to the corresponding target file and return access failure information.

[0125] The virtual path verification process provided in this embodiment ensures the reliability of the dynamic link library accessing the virtual path. At the same time, if the virtual path is not correct, it can stop the loss in time to prevent the dynamic link library from accessing the wrong virtual path and prolonging the fault recovery time.

[0126] In some embodiments, the target file corresponding to the target process is backed up in advance to the checkpoint file of the target process by snapshot mode to obtain the target sub-files corresponding to different time nodes, the target file and the snapshot paths corresponding to the target sub-files, including:

[0127] Create the corresponding target subvolume based on the target process in the checkpoint file in advance;

[0128] Back up the target file corresponding to the target process to the target subvolume through snapshot;

[0129] Pre-create target sub-files corresponding to target files at different time nodes in the target sub-volume;

[0130] The storage path of the target subvolume and the target subfile is used as the snapshot path.

[0131] Specifically, the corresponding target subvolume is created based on the target process in the checkpoint file. The subvolume in the file system (B-treeFile System, Btrfs) is a feature that allows users to create multiple independent file system volumes on the same physical storage device. Each subvolume is like having its own file system, with its own root directory, inode and other metadata, but in fact they are all stored in the same btrfs file system. The following are some of its key features:

[0132] 1) Isolation: Each subvolume is independent and has its own file tree and attributes. This means that changes in one subvolume will not affect other subvolumes.

[0133] 2) Snapshot function: Subvolumes are the basis for implementing snapshots. You can create snapshots of existing subvolumes, and these snapshots share data blocks with atomic volumes until the data changes. This makes snapshots very space-efficient and can be created quickly.

[0134] 3) Data recovery: If a subvolume is damaged, its snapshot can be used to recover the data.

[0135] Enter the home directory of the user who submitted the job in the scheduled computing node, and use the btrfs file system command to create a subvolume. Assuming that the user name of the job submitter is abc and the user's home directory is / home / abc, you can create a subvolume / home / abc / test. The created subvolume will be automatically mounted to / home / abc / test. The path of the subvolume here can be set to any path according to actual needs.

[0136] The purpose of creating subvolumes is, first, to limit the user's job process's access to the file system, that is, to create a subvolume for each job, and the job process can only access the files in the file system of the subvolume (unless there are multiple jobs that need to share files, multiple jobs can be allowed to use the same subvolume), which fundamentally guarantees the isolation between different processes and increases security and isolation between jobs. Second, subvolumes can be used to limit the capacity of the file system used by jobs. Third, by using the snapshot feature of the btrfs file system subvolume, a snapshot is created for the subvolume during checkpoint, thereby saving the file status of the job process at the checkpoint time, and restoring the subvolume to the checkpoint time when restarting, so that the files accessed by the job process are restored to the status at the checkpoint time.

[0137] The target file corresponding to the target process is backed up to the target subvolume by snapshot. At this time, the target subvolume pre-creates target subfiles corresponding to the target files corresponding to different time nodes. That is to say, one target file includes multiple target subfiles. The storage path of the target subvolume and the target subfile is used as the snapshot path to facilitate direct calling of the fault recovery file corresponding to the fault point corresponding to different time nodes.

[0138] The creation of subvolumes provided in this embodiment provides an isolated file system environment for each job, enhancing the security and isolation between jobs. At the same time, a backup operation is performed, and the snapshot and data integrity characteristics of the btrfs file system are used to ensure the consistency and integrity of data during the fault recovery process.

[0139] In some embodiments, the checkpoint operation process of the checkpoint file includes:

[0140] Add a scheduled task in advance when the target process is not started, so that a checkpoint file can be created when the target process starts;

[0141] A checkpoint operation of the checkpoint file is performed on the target process according to the first preset time interval, so that the target process can be restored to the checkpoint file when a failure occurs.

[0142] Specifically, before the user job is started, a scheduled task is started in the background. After the user job process is started, the scheduled task performs a checkpoint operation on the user job process or subprocess at a fixed time interval (a first preset time interval). Checkpoints are created for the user job process regularly so that the checkpoint can be restored in the event of a failure.

[0143] The automated scheduled checkpoint operation and fast recovery mechanism in this embodiment periodically save the job status, reduce computing interruptions and resource waste caused by faults, enhance system stability, and ensure the continuity and reliability of long-running jobs.

[0144] In some embodiments, it also includes:

[0145] When the target process accesses other subvolume directories outside the target subvolume, and the target process performs a read operation on other subvolume directories outside the target subvolume, the files in the other subvolume directories outside the target subvolume are not backed up in snapshot mode.

[0146] It should be noted that the implementation of the fakelibc library imposes restrictions on user job processes from accessing other directories, because only snapshots of subvolumes are created during checkpoint. If a process accesses directories other than subvolumes, snapshots cannot be created for them, and they cannot be restored. In some cases, a user process may need to access files outside the subvolume. If the user process only reads files outside the subvolume but does not write them, these files outside the subvolume will not change during the running of the user process (other programs modifying these files are not considered here). Therefore, there is no need to create snapshots of the contents of these files during checkpoint. In this case, the user can specify the need to access certain directories or files outside the subvolume when submitting a job.

[0147] The access provided in this embodiment is targeted at the designated subvolume, and access to other subvolume directories is prevented, thereby ensuring the stability of the system.

[0148] In some embodiments, the process of creating a checkpoint file includes:

[0149] Call monitoring function;

[0150] Freeze the target program of the target process according to the tracking command of the monitoring function;

[0151] Use the file system command to take a snapshot of the target subvolume of the target process to save the snapshot path; and save the snapshot path to the checkpoint file;

[0152] In the cluster node to which the target process belongs, the CPU image file and the memory image file are obtained according to the monitoring function, and written into the checkpoint file;

[0153] The offset of the target file is determined through the file positioning function so that the offset and file descriptor can be saved in the checkpoint file to complete the creation of the checkpoint file.

[0154] Specifically, the monitoring function (ptrace function) is called. Ptrace is a system call used for inter-process interaction in Linux systems, which allows one process ("parent process") to control another process ("child process"). Ptrace is mainly used for debugging purposes. It provides a mechanism that allows the parent process to monitor and manipulate the execution of the child process. The following are some key features of Ptrace:

[0155] 1) Control child process execution: The parent process can pause the execution of the child process, examine its state, modify its memory and registers, and then decide when and how to resume the execution of the child process.

[0156] 2) Check and change memory contents: ptrace allows the parent process to access the child process's memory space, including the code segment, data segment, and stack. This means that the parent process can read or modify the child process's memory contents.

[0157] 3) Handling signals: When a child process receives a signal, it can be suspended and the parent process will be notified. The parent process can choose how to handle the signal, for example, it can decide to ignore the signal and let the child process continue to execute, or handle the signal and change the state of the child process.

[0158] 4) Setting breakpoints: Ptrace can be used to set breakpoints so that when the child process executes to a specific code location, it will pause execution and the parent process can check the status at this time.

[0159] 5) Single-step execution: The parent process can control the child process to execute single-step, which is very useful during debugging and can check the behavior of the program instruction by instruction.

[0160] 6) Read and write registers: The parent process can read and modify the register values ​​of the child process, which is used to check and set the status of the program during debugging.

[0161] Freeze the target program of the target process according to the PTRACE_ATTACH or PTRACE_SEIZE command (tracing command) of the monitoring function; use the file system command to create a snapshot of the subvolume used by the user process. Assume that the path of the created subvolume snapshot is / home / abc / snapshot (the path of the snapshot can be specified according to actual needs), and save the path of the snapshot to the checkpoint file. The checkpoint file is an ordinary text file. Every time a checkpoint is made, we save the relevant information of the process status to the checkpoint file, and obtain the relevant information from the checkpoint file when restoring for restoration.

[0162] It should be noted that the process may have written files before the checkpoint, and the data written to the file may exist in the operating system cache and has not been actually written to the disk. At this time, the cache is refreshed here and the data is written to the disk.

[0163] In the cluster node to which the target process belongs, the CPU image file and the memory image file are obtained according to the monitoring function, and written into the checkpoint file. The monitoring function is used to complete. In some embodiments, in the cluster node to which the target process belongs, the CPU image file and the memory image file are obtained according to the monitoring function, and written into the checkpoint file, including:

[0164] Call the monitoring function to determine the register value of the target process;

[0165] Use register values ​​as CPU image file;

[0166] Inject parasitic code into the target process through the interface information corresponding to the monitoring function;

[0167] Obtain the target process's memory information through parasitic code;

[0168] Save the memory information to the corresponding disk file;

[0169] Use the saved disk file as a memory image file.

[0170] Specifically, before a failure occurs, the system creates checkpoints periodically or after critical operations. A checkpoint is a snapshot of the system state, including memory, registers, file descriptors, etc. Through PTRACE_GETREGS provided by ptrace, the values ​​of the registers of the user process are obtained, and the values ​​of the registers are saved to a file, which is called a CPU image file, and the path of the CPU image file is written to the checkpoint file. A special piece of code (called parasitic code) is injected into the user process through the ptrace interface. The parasitic code obtains the memory information of the user process and saves the memory data to a file on disk, which is called a memory image file, and the path of the memory image file is written to the checkpoint file.

[0171] The memory image file and the CPU image file obtained in this embodiment ensure that when a fault occurs, it can be quickly restored from the last saved state.

[0172] The offset of the target file is determined by the file positioning function (lseek function) to save the offset and file descriptor to the checkpoint file to complete the creation of the checkpoint file.

[0173] The Linux operating system lseek function can set the current offset of a file, so you can use the following method to get the current offset of an open file:

[0174] off_t currpos;

[0175] currpos = lseek(fd, 0, SEEK_CUR);

[0176] Fakelibc records which files are opened by the current process. The parasitic code triggers fakelibc to obtain the current offsets of all files opened by the current process and save the file descriptors (virtual file descriptors) and current offsets of all currently open files to the checkpoint file.

[0177] Because the execution code will change the values ​​of CS and IP registers, after the parasitic code is executed, the values ​​of CS, IP and other registers are restored to the values ​​before the parasitic code was injected. The dumpee program can be resumed by calling PTRACE_DETACH or PTACE_CONT of the ptrace function.

[0178] The creation of the checkpoint file provided in the embodiment of the present invention facilitates the process-level fault recovery technology, so as to realize the periodic saving of the operation status and improve the stability and reliability of the system.

[0179] In some embodiments, after creating a checkpoint file corresponding to the target process, the method further includes:

[0180] Get the checkpoint file of the previous target process;

[0181] Delete the checkpoint file of the previous target process.

[0182] To save disk space, you can choose to delete the previously created checkpoint-related files after each successful creation of a new checkpoint.

[0183] In this embodiment, the checkpoint files based on different target processes are updated and deleted regularly to ensure that there is sufficient space on the disk each time a fault recovery is performed.

[0184] In some embodiments, before obtaining the target process corresponding to the cluster node, the method further includes:

[0185] Receive the job progress sent by the user;

[0186] Schedule the job process to the cluster nodes;

[0187] When the parent process is running, a child process is created and the process proceeds to the step of obtaining the target process corresponding to the cluster node.

[0188] Specifically, when a user job process ends abnormally, the user job process can be restored through a checkpoint file saved at a scheduled time. Figure 2 A schematic diagram of a business failure recovery scenario provided by an embodiment of the present invention, such as Figure 2 As shown, the process is:

[0189] S21: User submits a job;

[0190] S22: Run the launcher on the computing node and set the environment variables;

[0191] S23: The launcher generates a child process;

[0192] S24: The initiator calls the waiting function;

[0193] S25: The child process restores memory data;

[0194] S26: The child process executes the call tracking function;

[0195] S27: The launcher restores the CPU registers of the child process;

[0196] S28: The initiator executes a continue execution command.

[0197] Specifically, 1. The user submits a new job to slurm and specifies that the job is still running on the original computing node. The program (executable file) to be executed by the job is called the launcher.

[0198] 2. The new job is scheduled by slurm to run on the original computing node.

[0199] 3. The launcher process runs. Set the path of the subvolume used by the user process in the environment variable. If the path of the subvolume snapshot in the checkpoint to be restored is / home / abc / snapshot, then the path of the subvolume used by the user process after restoration is / home / abc / snapshot. Set this path to the environment variable of the launcher process.

[0200] 4. The launcher executes fork to generate a child process, which inherits the environment variables of the parent process.

[0201] 5. Execute the wait function in the launcher process and wait for the signal to be received.

[0202] 6. In the child process, find the path of the saved memory image file from the checkpoint file and restore the data in the memory image file to the memory space of the new process.

[0203] 7. Execute PTRACE_TRACEME (tracing function) provided by ptrace in the child process, which will cause the launcher process to receive a SIGCHLD signal.

[0204] 8. After the launcher process receives the signal, it finds the path of the saved CPU image file from the checkpoint file, and restores the register values ​​in the CPU image file to the CPU context of the child process through PTRACE_SETREGS provided by ptrace.

[0205] 9. The launcher process resumes the child process through PTRACE_CONT (continue execution command) provided by ptrace, and the child process will continue to run from the state at the time of checkpoint.

[0206] At this time, the subprocess specifically restores the file by entering step S11 to perform restoration.

[0207] The above requires that the software required for checkpoint-restart be installed on the computing nodes of the slurm cluster. Checkpoint / Restore In Userspace (CRIU); the user submits the job to the slurm scheduling system. The checkpoint-restart here is a process-level fault recovery technology that allows the system to recover quickly after a failure. This technology is particularly suitable for application scenarios that require high availability or fault tolerance. The general steps of checkpoint-restart are as follows:

[0208] 1) Fault detection: The system needs to be able to detect faults, which may be achieved through timed heartbeat detection, anomaly capture, or other forms of monitoring.

[0209] 2) Checkpoint: Before a failure occurs, the system creates checkpoints periodically or after critical operations. Checkpoints are snapshots of the system state, including memory, registers, file descriptors, etc.

[0210] 3) Restart: Once a failure is detected, the system will use the most recent checkpoint to restore the state. This usually involves restarting the process and restoring the necessary information from the checkpoint.

[0211] CRIU is a software tool that runs on the Linux operating system and implements the checkpoint / restore function in user space. CRIU can be used to freeze a running program and checkpoint to a series of files associated with the program, and then use these files to restore the program to the point when it was frozen on any host. In other words, it is a backup and restore of the running program environment.

[0212] The process of CRIU checkpointing is as follows (the process to be checkpointed is called the dumpee process):

[0213] a.CRIU collects the process tree of the dumpee process, and then freezes the dumpee program through the PTRACE_ATTACH or PTRACE_SEIZE command of the ptrace function.

[0214] b. CRIU injects a special code (parasite code) into dumpee through the ptrace interface. This process is completed in two steps: first, the mmap system call is injected into the CS:IP position at the moment the task is frozen, and then ptrace allows us to run the injected system call, so that we can apply for enough memory in the monitored process for the parasite code block. Next, copy the parasite code to the newly applied memory address and point CS:IP to the location of the parasite code. The parasite code collects all the context information of the dumpee process, and then CRIU stores this context information as an image file.

[0215] c.CRIU resumes the dumpee program through PTRACE_DETACH or PTACE_CONT of the ptrace function.

[0216] When the restored user process (i.e. the child process forked by the launcher above) accesses the file, it will still be intercepted by the fakelibc library. The specific process is as follows:

[0217] 1. When the restored user process opens a file, the fakelibc library intercepts the open function call, obtains the path of the subvolume currently used by the process from the environment variable, and converts the virtual file path to the path on the subvolume currently used.

[0218] 2. When the recovered user process reads / writes files, the fakelibc library intercepts the read / write function call. Every time fakelibc opens a file, it records the real path of the opened file, the virtual path of the file, the real file descriptor, and the virtual file descriptor. After the user process is restored, the information of these opened files is also restored. However, because the restored process is a new process, the original real file descriptor is invalid. During the restoration, the real file descriptor in the open file information recorded in fakelibc is marked as invalid. After the process is restored, if the process uses the virtual file descriptor before restoration for the first time to perform read / write operations, fakelibc finds the corresponding real file descriptor through the virtual file descriptor, but the real file descriptor is invalid at this time. Fakelibc finds the virtual file path corresponding to this virtual file descriptor from the recorded open file information, and then obtains the path of the current subvolume through the environment variable, converts the virtual file path to the real file path, and then calls the operating system libc library open file. The file descriptor returned by the libc library open function is the real file descriptor, and the real file descriptor corresponding to the virtual file descriptor recorded in fakelibc is updated to the file descriptor returned by the libc library open function; the offset of the opened file is recorded during checkpoint. Here, after calling the libc library open function to open the file, fakelibc calls the libc library lseek function to position the file offset to the offset at the time of checkpoint, and then fakelibc calls the libc library read / write function to execute the user's read / write request.

[0219] In this embodiment, the checkpoint-restart mechanism of the process significantly improves the fault tolerance of the high-performance computing cluster and reduces the risk of job failure and re-execution caused by faults. When a fault occurs, it can quickly recover from the checkpoint state to avoid executing the job from the beginning, thereby reducing the waste of computing resources and improving resource utilization. The fast fault recovery capability reduces the interruption time of the job due to the fault, speeds up the execution of the job, and improves the overall job execution efficiency. The job process is transparent to the user, and there is no need to modify the job code or perform special operations, which simplifies the complexity of the user's use of high-performance computing resources and improves the user experience. Even if the system environment changes (such as the file system mount point changes), the virtual file system mechanism can ensure that the job process can correctly access the required files, which improves the flexibility and adaptability of the system. Through the automated fault recovery process, the maintenance and management burden of the system administrator is reduced and the management work is simplified. It allows it to be applied in different high-performance computing scenarios and different job types, with good scalability.

[0220] Figure 3 A schematic diagram of a file system failure recovery scenario provided by an embodiment of the present invention is shown in FIG. Figure 3 As shown in the figure, in a job process, its corresponding central processing unit and memory store it by creating a checkpoint file. For the file system in the corresponding job process, it is necessary to add a dynamic link library before the program language standard library, so that the dynamic link library intercepts the program language standard library to access the target file of the file system. At the same time, the target file is pre-stored in the checkpoint file through a subvolume snapshot. By introducing the concept of a virtual file system, the file access operation of the user job process is abstracted from the actual file system, so that the user job is decoupled from the underlying file system, and the flexibility and recoverability of the system are enhanced.

[0221] The above describes in detail various embodiments corresponding to the cluster service failure recovery method. On this basis, the present invention also discloses a cluster service failure recovery device corresponding to the above method. Figure 4 The structure diagram of a cluster service failure recovery device provided by an embodiment of the present invention. Figure 4 As shown in the figure, the service failure recovery equipment of the cluster includes:

[0222] The acquisition module 11 is used to acquire the target process corresponding to the cluster node; and call the request operation function corresponding to the pre-established dynamic link library according to the target process to determine the request operation information of the target process to be intercepted by the dynamic link library;

[0223] A first determining module 12, configured to determine a virtual path of a target file according to the request operation information and the target file corresponding to the target process;

[0224] The backup module 13 is used to back up the target file corresponding to the target process in advance to the checkpoint file of the target process in a snapshot manner to obtain the target sub-files corresponding to different time nodes, the target file and the snapshot paths corresponding to the target sub-files;

[0225] The second determination module 14 is used to obtain the real path of the target file in the target process; and determine the fault point of the target business corresponding to the target process after the dynamic link library intercepts the access and the fault recovery file corresponding to the target sub-file according to the relationship between the virtual path and the real path, and the relationship between the virtual path and the snapshot path, so as to facilitate recovery processing.

[0226] Since the embodiments of the device part correspond to the above embodiments, please refer to the description of the embodiments of the method part for the embodiments of the device part, and will not be repeated here.

[0227] For an introduction to a cluster service failure recovery device provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The device has the same beneficial effects as the above cluster service failure recovery method.

[0228] Figure 5 A structural diagram of a cluster service failure recovery device provided by an embodiment of the present invention, such as Figure 5 As shown, the device comprises:

[0229] A memory 21, used for storing computer programs;

[0230] The processor 22 is used to implement the steps of the cluster service failure recovery method when executing the computer program.

[0231] The cluster service failure recovery device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.

[0232] Among them, the processor 22 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 22 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 22 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU; the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 22 may be integrated with a GPU, which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 22 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.

[0233] The memory 21 may include one or more computer-readable storage media, which may be non-transitory. The memory 21 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 21 is at least used to store the following computer program 211, wherein, after the computer program is loaded and executed by the processor 22, the relevant steps of the cluster business fault recovery method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 21 may also include an operating system 212 and data 213, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 212 may include Windows, Unix, Linux, etc. The data 213 may include, but is not limited to, data involved in the cluster business fault recovery method, etc.

[0234] In some embodiments, the service failure recovery device of the cluster may further include a display screen 23 , an input / output interface 24 , a communication interface 25 , a power supply 26 , and a communication bus 27 .

[0235] Those skilled in the art can understand that Figure 5 The structure shown in the figure does not constitute a limitation on the service failure recovery device of the cluster, and may include more or fewer components than those shown in the figure.

[0236] The processor 22 implements the cluster service failure recovery method provided by any of the above embodiments by calling the instructions stored in the memory 21.

[0237] For an introduction to a cluster service failure recovery device provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The device has the same beneficial effects as the above cluster service failure recovery method.

[0238] Furthermore, the present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by the processor 22, the steps of the above-mentioned cluster service failure recovery method are implemented.

[0239] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program codes.

[0240] For an introduction to a computer-readable storage medium provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The computer-readable storage medium has the same beneficial effects as the above cluster service failure recovery method.

[0241] Furthermore, the present invention provides a computer program product, including a computer program / instruction, which implements the steps of a cluster service failure recovery method when executed by a processor.

[0242] For an introduction to a computer program product provided by the present invention, please refer to the above method embodiment, which will not be described in detail herein. The computer program product has the same beneficial effects as the above cluster service failure recovery method.

[0243] The above is a detailed introduction to a cluster service fault recovery method, device, medium and product provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.

[0244] It should also be noted that, in this specification, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.

Claims

1. A cluster service failure recovery method, characterized in that: Applicable to cluster nodes, including: Obtain the target process corresponding to the cluster node; and call the request operation function corresponding to the pre-established dynamic link library according to the target process to determine the request operation information of the target process to be intercepted by the dynamic link library; wherein the establishment process of the dynamic link library includes: obtaining the environment variable corresponding to the target process; setting the environment variable in the program before accessing the target file corresponding to the target process to establish the dynamic link library; the dynamic link library takes precedence over the program language standard library to force the loading of the target file corresponding to the target process before the program is started; the request operation information of the target process intercepted by the dynamic link library includes at least one or more request information corresponding to the open function, the write function and the read function; Determine a virtual path of the target file according to the request operation information and the target file corresponding to the target process; The target file corresponding to the target process is backed up in advance to the checkpoint file of the target process by snapshot mode to obtain the target subfiles corresponding to different time nodes, the target file and the snapshot paths corresponding to the target subfiles; wherein the creation process of the checkpoint file includes: calling a monitoring function; freezing the target program of the target process according to the tracking command of the monitoring function; taking a snapshot of the target subvolume of the target process by using a file system command to save the snapshot path; and saving the snapshot path to the checkpoint file; obtaining a CPU image file and a memory image file according to the monitoring function in the cluster node to which the target process belongs, and writing them to the checkpoint file; determining the offset of the target file by a file positioning function so as to save the offset and the file descriptor to the checkpoint file to complete the creation of the checkpoint file; Obtain the real path of the target file in the target process; and determine the failure point of the target business corresponding to the target process after the dynamic link library intercepts the access and the failure recovery file corresponding to the target sub-file according to the relationship between the virtual path and the real path, and the relationship between the virtual path and the snapshot path, so as to facilitate recovery processing.

2. The cluster service failure recovery method according to claim 1, characterized in that: When the request operation information of the target process to be intercepted by the dynamic link library is the open function, the process of intercepting the access by the dynamic link library includes: Pre-establishing a first file path corresponding to a target file of the request operation information corresponding to the open function; Using the first file path as the first virtual path of the target file; Obtain a first real path corresponding to a first file of request operation information corresponding to the open function of a programming language standard library; Establishing a mapping relationship between the first virtual path and the first real path in advance; Converting the first virtual path of the open function based on the dynamic link library into the first real path to call the open function of the program language standard library; The first virtual file descriptor of the dynamic link library is recorded according to the first real file descriptor of the open function of the program language standard library to determine that the dynamic link library intercepts the access successfully.

3. The cluster service failure recovery method according to claim 2, characterized in that: When the request operation information of the target process to be intercepted by the dynamic link library is the read function or the write function, the process of intercepting the access by the dynamic link library includes: Based on the acquisition of the first virtual file descriptor, acquiring a second virtual path of the target file corresponding to the read function or the write function; Determine a corresponding second virtual file descriptor according to the second virtual path; Determine a second real file descriptor corresponding to the read function or the write function according to a mapping relationship among the second virtual file descriptor, the first virtual file descriptor and the first real file descriptor; The read function or the write function of the programming language standard library is called according to the second real file descriptor to determine that the dynamic link library intercepts the access successfully.

4. The cluster service failure recovery method according to any one of claims 1 to 3, characterized in that: Backing up the target file corresponding to the target process in advance to the checkpoint file of the target process in a snapshot manner to obtain target sub-files corresponding to different time nodes, the target file and the snapshot paths corresponding to the target sub-files, including: Pre-create a corresponding target subvolume based on the target process in the checkpoint file; Backing up the target file corresponding to the target process to the target subvolume in a snapshot manner; Pre-creating target sub-files corresponding to target files corresponding to different time nodes in the target sub-volume; The storage paths of the target sub-volume and the target sub-file are used as the snapshot path.

5. The cluster service failure recovery method according to claim 4, characterized in that: The checkpoint operation process of the checkpoint file includes: Adding a scheduled task in advance when the target process is not started, so as to create the checkpoint file when the target process is started; A checkpoint operation of the checkpoint file is performed on the target process according to a first preset time interval, so that the target process can be restored to the checkpoint file when a failure occurs.

6. The cluster service failure recovery method according to claim 5, characterized in that: Also includes: When the target process accesses other subvolume directories outside the target subvolume and the target process performs a read operation on other subvolume directories outside the target subvolume, the files in other subvolume directories outside the target subvolume are not backed up in snapshot mode.

7. The cluster service failure recovery method according to claim 1, characterized in that: In the cluster node to which the target process belongs, a CPU image file and a memory image file are obtained according to the monitoring function, and written into the checkpoint file, including: Calling the monitoring function to determine the register value of the target process; Using the register value as the CPU image file; Injecting parasitic code into the target process through the interface information corresponding to the monitoring function; Acquiring memory information of the target process through the parasitic code; Saving the memory information to a corresponding disk file; The saved disk file is used as the memory image file.

8. The cluster service failure recovery method according to claim 7, characterized in that: After creating the checkpoint file corresponding to the target process, the method further includes: Get the checkpoint file of the previous target process; Delete the checkpoint file of the previous target process.

9. The cluster service failure recovery method according to claim 1, characterized in that: Before obtaining the target process corresponding to the cluster node, the method further includes: Receive the job progress sent by the user; Dispatching the job process to the cluster node; When the parent process is running, a child process is created and the process proceeds to the step of obtaining the target process corresponding to the cluster node.

10. A cluster service failure recovery device, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the cluster service failure recovery method according to any one of claims 1 to 9 when executing the computer program.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cluster service failure recovery method according to any one of claims 1 to 9 are implemented.

12. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the cluster service failure recovery method described in any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Distributed system multilevel fault tolerance method under cloud environment

    CN103778031A

  • Highly available stateful containers in cluster environment

    CN110520843A

  • Fault simulation method and device and related equipment

    CN115470141A

  • Resilient backups for large Hyper-V cluster shared volume environments

    US10417099B1

  • Compliance namespace separation to achieve snapshot based consistency across failover-failback while maintaining data retention regulation compliance

    US11200207B1