Log backup method and system of distributed file system and medium

By dynamically allocating log backup tasks between the host and the SmartNIC, the problems of PCIe bandwidth limitations and high CPU usage in the client-local distributed file system are resolved, achieving higher system throughput and resource utilization efficiency.

CN116541361BActive Publication Date: 2025-10-10SHANGHAI JIAOTONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310546086.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-15
Publication Date
2025-10-10
Estimated Expiration
2043-05-15

AI Technical Summary

Technical Problem

Existing client-local distributed file systems, when using Smart NICs and non-volatile memory, suffer from PCIe bandwidth limitations, high CPU usage, and resource contention, which restrict system throughput and performance.

Method used

A hybrid execution approach is adopted to dynamically allocate log backup tasks between the host machine and the Smart NIC, use RDMA and DMA operations to directly write to the host machine or offload through the Smart NIC to copy and publish logs, and combine multi-core worker threads for log copying and migration to optimize bandwidth usage and resource allocation.

Benefits of technology

It effectively alleviates the PCIe bottleneck caused by the smart network card architecture, improves system throughput, reduces CPU usage and resource competition, and improves log transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116541361B_ABST
    Figure CN116541361B_ABST
Patent Text Reader

Abstract

The application provides a log backup method and system of a distributed file system and a medium, relates to the technical field of distributed file systems, and comprises the following steps: S1, file operation information is acquired and a log is generated, which is persisted on a nonvolatile memory; S2, the use of the current network card PCIe bandwidth is judged, and log replication backup is selected to be directly performed on a host or in the form of smart card offloading; S3, the log is copied from a private log area of the nonvolatile memory to a public log area, and the log publishing process is completed; S4, a backup machine receives a request, and meanwhile, the log is copied from the private log area of the nonvolatile memory to the public log area; and S5, the whole system completes a file operation, and the next file operation is performed.The application can better utilize the bandwidth between a smart card and a host, can utilize the additional computing power of the smart card to compress data to improve network transmission efficiency, and meanwhile, does not occupy an additional host processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of distributed file systems, and in particular to a distributed file system log backup device suitable for smart network cards and non-volatile memories, and specifically to a distributed file system log backup method, system, and medium. Background Art

[0002] The file system is a crucial component of an operating system. In an operating system, most data is stored on storage devices, such as disks and USB drives. The file system is the operating system's abstraction for controlling data on these storage devices. In simple terms, the file system determines how files are named, where they are stored on the media, and how the operating system accesses data on the storage device. To address the diverse nature of storage media, current operating systems support a variety of file systems, such as FAT, NTFS, and EXT.

[0003] Initially, each computer was built to run a single application. This application controlled the entire machine and sent commands to write data directly to storage media, with the specific write location controlled by the application. Later, computers that ran multiple applications were developed, requiring a mechanism to isolate data writes between applications to prevent them from interfering with each other. File systems were designed to ensure this. Applications no longer needed to interact directly with storage devices; they simply instructed the file system to write data blocks to disk, leaving the file system to perform the operations.

[0004] As you can see, file systems were originally designed for single machines. However, as storage requirements, such as capacity, performance, and reliability, increased over time, single-machine file systems could no longer meet these demands. Distributed file systems were developed to address these issues. A distributed file system consists of multiple file servers, which communicate and transfer data over a computer network. Clients also interact with the file servers over the computer network to write and read data.

[0005] However, the traditional client-server distributed file system architecture has its problems. In a client-server architecture, data is stored on the server, while the client is solely responsible for running the application. The client's memory can be viewed as a buffer managed by the client's operating system kernel. This design simply lets the server manage data consistency, eliminating the need for complex protocol design.

[0006] With this design, application performance is limited by the overhead of client access to kernel buffers. When accessing data not in the kernel buffers, the client must make multiple network round trips to retrieve the data from the server. Furthermore, if a client fails and needs to recover and rebuild data, these caches must be reloaded, consuming significant network bandwidth.

[0007] Therefore, a client-local distributed file system architecture based on non-volatile memory has been proposed. In this architecture, data is stored directly in the client machine's non-volatile memory, and data consistency is guaranteed through synchronization using a specific protocol. However, without a server, all workloads are performed by the client. This places additional CPU load on the client machine. In cases of frequent file operations, this can even cause resource competition with applications running on the client machine, impacting application performance.

[0008] To address this issue, distributed file systems that use Smart NICs for task offloading were developed. By using Smart NICs to offload CPU-intensive tasks, such as log replication and publishing, and consistency control, they effectively alleviate resource competition between the file system and applications in a client-local architecture. However, this technical solution is limited by the Smart NIC's inherent architecture. At high throughput, the system is limited by the Smart NIC's PCIe bandwidth, preventing it from achieving higher system throughput.

[0009] In general, existing technologies still have significant shortcomings for client-local distributed file systems using smart network cards and non-volatile memory. Summary of the Invention

[0010] In view of the deficiencies in the prior art, the present invention provides a log backup method, system and medium for a distributed file system.

[0011] According to the present invention, a log backup method, system, and medium for a distributed file system are provided, and the scheme is as follows:

[0012] In a first aspect, a log backup method for a distributed file system is provided, the method comprising:

[0013] Step S1: Obtain file operation information and generate a log, which is persisted in non-volatile memory;

[0014] Step S2: Determine the current usage of the network card PCIe bandwidth and choose to copy and back up the logs directly on the host machine or to copy and back up the logs through the smart network card offload method;

[0015] Step S3: Copy the log from the private log area of ​​the non-volatile memory to the public log area to complete the log publishing process;

[0016] Step S4: The backup machine receives the request and copies the log from the private log area of ​​the non-volatile memory to the public log area;

[0017] Step S5: The entire system completes one file operation and proceeds to the next file operation.

[0018] Preferably, step S2 includes: if the proportion of PCIe bandwidth occupied by the smart network card is too high, directly copying and backing up the logs on the host machine; otherwise, copying and backing up the logs by offloading the smart network card.

[0019] Preferably, the file operation information obtained in step S1 needs to be intercepted and obtained through a system call interception library.

[0020] Preferably, directly performing the copy backup of the log on the host machine in step S2 includes: directly writing the log to a corresponding location on the non-volatile memory of the backup machine through an RDMA WRITE operation.

[0021] Preferably, the copying and backing up of the log by means of smart network card offloading in step S2 includes: sending an RPC to the smart network card, and the smart network card performing an RDMA READ or DMA READ operation to read the log from the non-volatile memory of the machine into the network card memory, and then compressing the log and transmitting the log to the smart network card of the backup machine through an RDMA WRITE operation, and the smart network card of the backup machine decompressing the log and writing the log to the corresponding location on the non-volatile memory of the backup machine through an RDMA WRITE or DMA WRITE operation.

[0022] Preferably, the copying of logs in the log publishing process is performed by using worker threads in multiple cores.

[0023] Preferably, when the log publishing process is directly executed by the host machine, the host machine directly migrates the log.

[0024] Preferably, the log publishing process is performed by the smart network card sending an RPC request to notify the host machine to migrate the log when the smart network card is used for offloading.

[0025] In a second aspect, a log backup system for a distributed file system is provided, the system comprising: a host machine and a backup machine, wherein the host machine and the backup machine are both equipped with a smart network card and a non-volatile memory;

[0026] The host performs file operations and persists the generated log information in non-volatile memory. It then makes judgments based on the overall system resource usage and transmits the log to a remote backup machine.

[0027] In a third aspect, a computer-readable storage medium storing a computer program is provided, wherein the computer program, when executed by a processor, implements the steps in the log backup method of the distributed file system.

[0028] Compared with the prior art, the present invention has the following beneficial effects:

[0029] 1. Through hybrid execution, the system effectively alleviates the PCIe bottleneck caused by the Smart NIC architecture when using Smart NIC for offloading, achieving higher system throughput.

[0030] 2. Through hybrid execution, it effectively alleviates the high CPU usage of the entire system and resource competition between the file system and applications in the traditional client-local architecture;

[0031] 3. Use the computing power of the Smart NIC to compress logs, improving the efficiency of log transmission without increasing the host processor usage.

[0032] Other beneficial effects of the present invention will be explained through the introduction of specific technical features and technical solutions in the specific implementation methods. Those skilled in the art should be able to understand the beneficial technical effects brought about by the introduction of these technical features and technical solutions. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:

[0034] Figure 1 The overall flow chart for the invention;

[0035] Figure 2 This is a diagram of the log replication and publishing process of a distributed file system;

[0036] Figure 3 A schematic diagram of the hardware device structure. DETAILED DESCRIPTION

[0037] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.

[0038] The embodiment of the present invention provides a log backup method for a distributed file system. Figure 1 As shown, the method specifically includes:

[0039] Step S1: Obtain file operation information and generate a log, which is persisted in non-volatile memory. Obtaining file operation information requires interception through the system call interception library.

[0040] Step S2: Determine the current usage of the network card's PCIe bandwidth, and choose to copy and back up the logs directly on the host machine or to copy and back up the logs by offloading the smart network card (hybrid execution method). If the proportion of PCIe bandwidth occupied by the smart network card is too high, copy and back up the logs directly on the host machine; otherwise, copy and back up the logs by offloading the smart network card (assuming that the network bandwidth is N and the PCIe bandwidth is P. When the traffic between the host and the network card is less than PN, use the smart network card for offloading, otherwise the host directly backs up the logs).

[0041] Directly replicating and backing up the logs on the host machine involves writing the logs directly to the corresponding location in the non-volatile memory of the backup machine using an RDMA WRITE operation. In this embodiment, the RDMA WRITE operation is the local end's active writing to the remote end's memory. Aside from the preparation phase, the remote end's CPU does not need to participate and is unaware of when data is written or received.

[0042] The method of copying and backing up the log by offloading the smart network card includes: sending an RPC (RPC generally refers to remote procedure call) to the smart network card, and the smart network card performs an RDMA READ or DMA READ operation to read the log from the non-volatile memory of the machine to the network card memory, and then compresses the log and transmits it to the smart network card of the backup machine through an RDMA WRITE operation, and the smart network card of the backup machine decompresses the log and writes it to the corresponding location on the non-volatile memory of the backup machine through an RDMA WRITE or DMA WRITE operation. In this embodiment, the DMA READ / WRITE operation is the behavior of the smart network card end actively accessing the host end memory and performing memory copying. Except for the preparation stage, the host end CPU does not need to participate, nor does it perceive when data is read remotely. In this embodiment, the RDMA READ operation is the behavior of the local end actively reading the remote memory. Except for the preparation stage, the remote end CPU does not need to participate, nor does it perceive when data is read remotely.

[0043] Step S3: Copy the log from the private log area of ​​the non-volatile memory to the public log area to complete the log publishing process.

[0044] Step S4: The backup machine receives the request and copies the log from the private log area of ​​the non-volatile memory to the public log area.

[0045] During the log publishing process, logs are copied using worker threads in multiple cores. When the log publishing process is executed directly by the host, the host directly migrates the logs. When the log publishing process is offloaded using the Smart NIC, the Smart NIC sends an RPC request to notify the host to migrate the logs.

[0046] Step S5: The entire system completes one file operation and proceeds to the next file operation.

[0047] The present invention also provides a log backup system for a distributed file system, the system comprising: a host machine and a backup machine, wherein both the host machine and the backup machine are equipped with a smart network card and a non-volatile memory;

[0048] The host performs file operations and persists the generated log information in non-volatile memory. It then makes judgments based on the overall system resource usage and transmits the log to a remote backup machine.

[0049] Next, the present invention will be described in more detail.

[0050] Reference Figure 2 The following is a specific process of the present invention to perform file WRITE operation, completing the log replication and publishing process of the distributed file system. Figure 1 Describe the following steps in detail:

[0051] 1) In this step, the application on the primary machine calls a write operation to write data to a file, and then executes step 2);

[0052] 2) In this step, the file system on the primary machine intercepts the write system call and then executes step 3);

[0053] 3) In this step, the file system on the primary machine obtains the data of the write operation, generates a log based on this data, and then executes step 4);

[0054] 4) In this step, the main machine determines whether the current proportion of PCIe bandwidth occupied by the smart network card is too high. If so, it executes step 10); otherwise, it executes step 5);

[0055] 5) In this step, the main machine sends an RPC to the smart network card, and then proceeds to step 6);

[0056] 6) In this step, the Smart NIC of the primary machine reads the log from the non-volatile memory of the host machine through an RDMA READ or DMA READ, and then proceeds to step 7);

[0057] 7) In this step, the primary machine's Smart NIC compresses the read logs and then writes the compressed logs to the backup machine's Smart NIC through an RDMAWRITE operation, and then proceeds to step 8);

[0058] 8) In this step, the backup machine's Smart NIC decompresses the log and writes the log to the backup machine's non-volatile memory through an RDMA WRITE or DMA WRITE operation, and then proceeds to step 10);

[0059] 9) In this step, the primary machine directly writes the log to the non-volatile memory of the backup machine through an RDMA WRITE operation, and then proceeds to step 10);

[0060] 10) In this step, the primary machine and the backup machine perform a log publishing operation, publishing the log from the private area of ​​the application to the public area visible to all applications.

[0061] like Figure 3 As shown, the present invention combines multiple computers equipped with smart network cards and non-volatile memory into a system to implement a new client-local distributed file system. The present invention is composed of multiple computers equipped with smart network cards and non-volatile memory.

[0062] Embodiments of the present invention provide a log backup method, system, and medium for a distributed file system, which can better utilize the bandwidth between a smart network card and a host machine, and can use the additional computing power of the smart network card to compress data to improve network transmission efficiency, while not occupying additional host machine processors.

[0063] Those skilled in the art will appreciate that, in addition to implementing the system and its various devices, modules, and units provided by the present invention in purely computer-readable program code, it is entirely possible to implement the same functions of the system and its various devices, modules, and units provided by the present invention in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, the system and its various devices, modules, and units provided by the present invention can be considered a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; the devices, modules, and units for implementing various functions can also be considered as both software modules implementing the method and structures within the hardware component.

[0064] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.

Claims

1. A log backup method for a distributed file system, characterized in that: include: Step S1: Obtain file operation information and generate a log, which is persisted in non-volatile memory; Step S2: Determine the current usage of the network card PCIe bandwidth and choose to copy and back up the logs directly on the host machine or to copy and back up the logs through the smart network card offload method; Step S3: Copy the log from the private log area of ​​the non-volatile memory to the public log area to complete the log publishing process; Step S4: The backup machine receives the request and copies the log from the private log area of ​​the non-volatile memory to the public log area; Step S5: The entire system completes one file operation and proceeds to the next file operation; Step S2 includes: if the proportion of PCIe bandwidth occupied by the smart network card is too high, directly copying and backing up the logs on the host machine; otherwise, copying and backing up the logs by offloading the smart network card; The step S2 of directly copying and backing up the log on the host machine includes: writing the log directly to a corresponding location on the non-volatile memory of the backup machine through an RDMA WRITE operation; The log replication and backup by means of smart network card offloading in step S2 includes: sending an RPC to the smart network card, and the smart network card performing an RDMAREAD or DMAREAD operation to read the log from the non-volatile memory of the machine to the network card memory, and then compressing the log and transmitting it to the smart network card of the backup machine through an RDMAWRITE operation. The smart network card of the backup machine decompresses the log and writes the log to the corresponding location on the non-volatile memory of the backup machine through an RDMAWRITE or DMA WRITE operation.

2. The log backup method of a distributed file system according to claim 1, characterized in that: The file operation information obtained in step S1 needs to be intercepted and obtained through the system call interception library.

3. The log backup method of a distributed file system according to claim 1, wherein: In the log publishing process, the copying of logs is performed by using worker threads in multiple cores.

4. The log backup method of a distributed file system according to claim 1, wherein: When the log publishing process is directly executed by the host machine, the host machine directly migrates the log.

5. The log backup method of a distributed file system according to claim 1, characterized in that: The log publishing process is performed by the smart network card sending an RPC request to notify the host machine to migrate the log when the smart network card is used for offloading.

6. A distributed file system log backup system, based on the distributed file system log backup method according to any one of claims 1 to 5, characterized in that: include: A host machine and a backup machine, wherein both the host machine and the backup machine are equipped with a smart network card and a non-volatile memory; The host performs file operations and persists the generated log information in non-volatile memory. It then makes judgments based on the overall system resource usage and transmits the log to a remote backup machine.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the log backup method of the distributed file system according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and system for transmitting archived logs and medium

    CN112910694A