Search

CN-121996633-A - File operation processing method and device

CN121996633ACN 121996633 ACN121996633 ACN 121996633ACN-121996633-A

Abstract

The invention discloses a file operation processing method and device, and relates to the technical field of distributed file processing. The method and the device for processing the concurrent file operation comprise the steps of receiving a read-write operation request for the target file sent by a client by using a processing server, receiving a cutoff operation request for the target file sent by the client and forwarding the cutoff operation request for the target file by using an information server, determining the concurrent operation sequence of the read-write operation and the cutoff operation, executing the read-write operation and the cutoff operation based on the concurrent operation sequence, and further sending first feedback information corresponding to the cutoff operation and second operation feedback information corresponding to the read-write operation.

Inventors

  • JIANG YANG
  • FEI FEI
  • FU GENXI
  • ZHENG JING
  • ZHU BIN

Assignees

  • 京东科技信息技术有限公司

Dates

Publication Date
20260508
Application Date
20260129

Claims (12)

  1. 1. The file operation processing method is characterized by being applied to a file operation processing system and comprising a client, an information server and a processing server; the processing server receives a read-write operation request for a target file sent by the client and receives a truncation operation request for the target file sent by the information server; the processing server determines the concurrent operation sequence of the read-write operation and the cut-off operation, and executes the read-write operation and the cut-off operation based on the concurrent operation sequence; the processing server sends first feedback information corresponding to the cut-off operation to the information server, so that the information server forwards the first feedback information to the client after determining that the first feedback information sent by all the processing servers is received, and the processing server sends second operation feedback information corresponding to the read-write operation to the client.
  2. 2. The method of claim 1, wherein the step of determining the position of the substrate comprises, The processing server acquires the read-write operation request and the target data block indicated by the cut-off operation request; and the processing server indicates the read-write operation state or the cut-off operation state by using the state identification of the target data block in the process of executing the read-write operation and the cut-off operation.
  3. 3. The method of claim 2, wherein the step of determining the position of the substrate comprises, After receiving a request of the information server for intercepting the target file sent by the client, the processing server sets a state identifier of the target data block to be in an intercepting operation state, and feeds back first feedback information indicating that the intercepting operation is successful to the information server; After receiving the read-write operation request for the target file sent by the client, the processing server sets the state identifier of the target data block to be in a read-write operation state, and feeds back second feedback information indicating that the read-write operation is successful to the client.
  4. 4. The method of claim 3, wherein the step of, The read-write operation comprises a write operation and a read operation; The processing server judges the state identification of the target data block after receiving the request of the information server for cutting operation of the target file sent by the client, Determining that the concurrent operation sequence of the read-write operation and the cut-off operation is the prior write operation and the cut-off operation is the subsequent write operation under the condition that the state identification indicates the write operation state; and under the condition that the state identification indicates the cut-off operation state, determining the concurrent operation sequence of the read-write operation and the cut-off operation as the cut-off operation preceding, and the write operation or the read operation following.
  5. 5. The method of claim 4, wherein the step of determining the position of the first electrode is performed, For the case that the concurrent operation sequence of the read-write operation and the cut-off operation is determined to be that the write operation is prior, the cut-off operation is subsequent, The processing server executes the read-write operation and the cut-off operation based on the concurrent operation sequence, including: Executing the writing operation, suspending the cutting operation to wait for the writing operation to finish; after determining that the write operation is complete, the truncate operation is resumed and performed.
  6. 6. The method of claim 4, wherein the step of determining the position of the first electrode is performed, For determining that the concurrent operation sequence of the read-write operation and the cut-off operation is the case that the cut-off operation is prior, the write operation is subsequent, The processing server executes the read-write operation and the cut-off operation based on the concurrent operation sequence, including: Executing the cut-off operation, suspending the write operation to wait for the cut-off operation to be completed; After determining that the write operation is completed, the write operation is resumed and performed.
  7. 7. The method of claim 4, wherein the step of determining the position of the first electrode is performed, For the case that the concurrent operation sequence of the read-write operation and the cut-off operation is determined to be the cut-off operation before, the read operation is subsequent, The processing server executes the read-write operation and the cut-off operation based on the concurrent operation sequence, including: performing a truncation operation; Setting a data interval of the target data block to be a preset value; and returning the preset numerical value as second feedback information of the reading operation request to the client.
  8. 8. The method of claim 2, wherein the step of determining the position of the substrate comprises, The processing server indicates a read-write operation state or a cut-off operation state by using the state identification of the target data block in the process of executing the read-write operation and the cut-off operation, and the processing server comprises: And setting the state identifier to be a preset state under the condition that the read-write operation and the cut-off operation aiming at the target data block are completed.
  9. 9. The file operation processing server is characterized by comprising a receiving request module, an executing operation module and a sending feedback module, wherein, The receiving request module is used for receiving a read-write operation request for a target file sent by the client and forwarding a truncation operation request for the target file sent by the client by the information receiving server; The execution operation module is used for determining the concurrent operation sequence of the read-write operation and the cut-off operation; The sending feedback module is configured to send first feedback information corresponding to the truncation operation to the information server, so that the information server determines that after receiving the first feedback information sent by all file operation processing servers, the information server forwards the first feedback information to the client, and sends second operation feedback information corresponding to the read-write operation to the client.
  10. 10. An electronic device, comprising: One or more processors; Storage means for storing one or more programs, When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1-8.
  11. 11. A computer readable medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements the method according to any of claims 1-8.
  12. 12. A computer program product comprising a computer program, characterized in that the program, when executed by a processor, implements the method according to any of claims 1-8.

Description

File operation processing method and device Technical Field The present invention relates to the field of distributed file processing technologies, and in particular, to a method and an apparatus for processing a file operation. Background In a distributed file system, there are multiple operations for a file, such as a read-write operation, a truncate operation, etc., and in a practical scenario, the same file often receives multiple different types of operation requests at the same time (e.g., a write request and a truncate request are received at the same time). The existing method generally utilizes the metadata service node to receive the interception requests, maintains and records specific interception data corresponding to each interception request, and simultaneously, the client needs to additionally carry interception information in order to prevent newly written data from being intercepted or read stale data when initiating the read-write request. Disclosure of Invention In view of the above, the embodiment of the invention provides a file operation processing method and device, which are applied to a file operation processing system, and can utilize a processing server to receive a read-write operation request for a target file sent by a client and to receive a cut-off operation request for the target file sent by an information server forwarding client, determine the concurrent operation sequence of the read-write operation and the cut-off operation, execute the read-write operation and the cut-off operation based on the concurrent operation sequence, and further send first feedback information corresponding to the cut-off operation and second operation feedback information corresponding to the read-write operation. In order to achieve the above object, according to one aspect of the embodiments of the present invention, there is provided a file operation processing method applied to a file operation processing system, including a client, an information server, and a processing server; The processing server receives a read-write operation request for the target file sent by the client and receives a cut-off operation request for the target file sent by the information server forwarding client; The processing server determines the concurrent operation sequence of the read-write operation and the cut-off operation, and executes the read-write operation and the cut-off operation based on the concurrent operation sequence; The processing server sends first feedback information corresponding to the cut-off operation to the information server, so that the information server forwards the first feedback information to the client after determining that the first feedback information sent by all the processing servers is received, and the processing server sends second operation feedback information corresponding to the read-write operation to the client. Optionally, the processing server acquires the read-write operation request and the target data block indicated by the cut-off operation request, and indicates the read-write operation state or the cut-off operation state by using the state identification of the target data block in the process of executing the read-write operation and the cut-off operation. Optionally, after receiving the request of the information server for intercepting the target file sent by the client, the processing server sets the state identifier of the target data block to be in an intercepting operation state and feeds back first feedback information indicating that the intercepting operation is successful to the information server, and after receiving the request of the client for reading and writing the target file sent by the client, the processing server sets the state identifier of the target data block to be in a reading and writing operation state and feeds back second feedback information indicating that the reading and writing operation is successful to the client. The processing server judges the state identification of the target data block after receiving the request of the information server forwarding the interception operation of the target file sent by the client, determines that the concurrent operation sequence of the reading and writing operation and the interception operation is the prior operation of the writing operation when the state identification is determined to be indicated as the writing operation state, and determines that the concurrent operation sequence of the reading and writing operation and the interception operation is the prior operation of the interception operation when the state identification is determined to be indicated as the interception operation state, and the writing operation or the reading operation is the subsequent operation when the state identification is determined to be indicated as the interception operation state. Optionally, for the case that the concurrent operation sequence of the read-write operation and the cut-o