CN113568881A - Method, system, equipment and medium for realizing read-write sharing - Google Patents

Method, system, equipment and medium for realizing read-write sharing Download PDF

Info

Publication number
CN113568881A
CN113568881A CN202110656287.3A CN202110656287A CN113568881A CN 113568881 A CN113568881 A CN 113568881A CN 202110656287 A CN202110656287 A CN 202110656287A CN 113568881 A CN113568881 A CN 113568881A
Authority
CN
China
Prior art keywords
read
write
permission
cache
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110656287.3A
Other languages
Chinese (zh)
Inventor
苏志恒
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202110656287.3A priority Critical patent/CN113568881A/en
Publication of CN113568881A publication Critical patent/CN113568881A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a method, a system, equipment and a storage medium for realizing read-write sharing, wherein the method comprises the following steps: responding to the preparation of opening a file in a read, write or read-write mixed mode, setting a corresponding value for an opening mode field value in a handle of the file according to the type of operation, and adding a read-write shared identifier; responding to the successful file opening, sending a request for applying permission to a metadata server side based on the opening mode field value and the read-write sharing identification, and receiving an application result; responding to the success of the permission application and reading or writing the file, and judging whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and responding to the current authority to read the cache authority, write the cache authority or read-write sharing authority, and performing cache reading or cache writing on the file. The invention realizes the support of multi-client mixed read-write sharing by using the read-write sharing technology, and improves the usability and the robustness of the distributed system.

Description

Method, system, equipment and medium for realizing read-write sharing
Technical Field
The present invention relates to the field of distributed systems, and more particularly, to a method, a system, a computer device, and a readable medium for implementing read-write sharing.
Background
In a distributed storage system, based on a data consistency function realized when a plurality of clients read and write files in a mixed manner, the existing method is as follows: before a client reads and writes a file, the client needs to apply corresponding read-write permission and read-write caching permission (the read permission and the read-write caching permission are applied during file reading and the write permission and the write-cache permission are applied during file writing) to a metadata server, when other clients write or mixedly read and write the file and apply the permission to the metadata server, the metadata server recovers the read-write caching permission of other clients to the file, and forces all the clients to perform synchronous read-write IO (input and output) on the file, namely, each read-write operation needs to be executed in series, and before the data is written into a storage medium or read from the storage medium successfully, the subsequent read/write operation is in a blocking state to ensure the data consistency.
The read-write IO is synchronized to cause the read-write performance of the client to be reduced, and especially when multiple clients perform mixed read-write on the same file and the block size is small, the influence of the synchronous read-write IO on the performance of the client is enlarged; in a high-performance computing scene of scientific computing application, the situation that multiple clients read and write the same file simultaneously (the read and write positions are different) exists, the performance requirement is high, if the multiple clients read and write the file in a mixed manner, the read and write are executed in series, the computing performance is seriously influenced, the read and write times of a storage medium are increased, the service life of the storage medium is shortened, and the performance advantage of a distributed system cannot be fully exerted.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method, a system, a computer device, and a computer readable storage medium for implementing read-write sharing, which improve synchronous read-write performance. By endowing a shared mark to a file which is shared and read and written, when a plurality of clients read and write the file in a mixed way, when the clients hold read-write cache permission or a shared mark, the clients are allowed to read and write cache, and the upper application program ensures the consistency of data by calling a corresponding data consistency interface function; by releasing the requirement of data consistency, the performance of hybrid reading and writing or simultaneous reading and writing of multiple clients is greatly improved, and the client response capability and the usability of a distributed system are improved.
Based on the above object, an aspect of the embodiments of the present invention provides a method for implementing read-write sharing, including the following steps: responding to the preparation of opening a file in a read, write or read-write mixed mode, setting a corresponding value for an opening mode field value in a handle of the file according to the type of operation, and adding a read-write shared identifier; responding to the successful file opening, sending a request for applying permission to a metadata server side based on the opening mode field value and the read-write sharing identification, and receiving an application result; responding to the success of the permission application and reading or writing the file, and judging whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and responding to the current authority to read the cache authority, write the cache authority or read-write sharing authority, and performing cache reading or cache writing on the file.
In some embodiments, the method further comprises: and in response to receiving a request for recovering the read-write sharing permission or recovering the write cache permission, printing the data in the cache to a storage medium and then releasing the corresponding permission.
In some embodiments, the method further comprises: and responding to the received request for recovering the read-write sharing permission or recovering the read cache permission, and releasing the corresponding permission after invalidating the data in the cache.
In some embodiments, the sending a request for applying for permission to a metadata server side based on the opening mode field value and the read-write sharing identifier and receiving an application result includes: and recording the field value of the opening mode into a metadata field of a metadata server side file, and returning corresponding authority according to the metadata field and the read-write sharing identification.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: judging whether a client performs read operation and/or write operation on the file currently; and responding to the fact that no client exists at present to carry out read operation and/or write operation on the file, and returning the read cache permission and/or the write cache permission according to the metadata field.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: and in response to the current existence of the client, performing read operation and/or write operation on the file, and recovering the read-write sharing permission and the read-cache permission and/or the write-cache permission of the client.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: and responding to the completion of the recovery permission, and returning the read-write sharing permission and the read caching permission and/or the write caching permission based on the metadata field.
In another aspect of the embodiments of the present invention, a system for implementing read-write sharing is provided, including: the identification module is configured to respond to the preparation of opening a file in a read, write or read-write mixed mode, set a corresponding value for an opening mode field value in a handle of the file according to the type of operation and add a read-write shared identification; the application module is configured to respond to the successful file opening and send a request for applying permission to the metadata server side based on the opening mode field value and the read-write sharing identification and receive an application result; the judging module is configured to respond to success of the permission application and read or write the file, and judge whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and the execution module is configured to respond to the read cache permission, the write cache permission or the read-write sharing permission in the current permission and perform cache reading or cache writing on the file.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method as above.
In a further aspect of the embodiments of the present invention, a computer-readable storage medium is also provided, in which a computer program for implementing the above method steps is stored when the computer program is executed by a processor.
The invention has the following beneficial technical effects: the synchronous read-write performance is improved. By endowing a shared mark to a file which is shared and read and written, when a plurality of clients read and write the file in a mixed way, when the clients hold read-write cache permission or a shared mark, the clients are allowed to read and write cache, and the upper application program ensures the consistency of data by calling a corresponding data consistency interface function; by releasing the requirement of data consistency, the performance of hybrid reading and writing or simultaneous reading and writing of multiple clients is greatly improved, and the client response capability and the usability of a distributed system are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a schematic diagram of an embodiment of a method for implementing read-write sharing according to the present invention;
FIG. 2 is a schematic diagram of a hardware structure of an embodiment of a computer device for implementing read-write sharing according to the present invention;
FIG. 3 is a schematic diagram of an embodiment of a computer storage medium for implementing read-write sharing according to the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In a first aspect of the embodiments of the present invention, an embodiment of a method for implementing read-write sharing is provided. Fig. 1 is a schematic diagram illustrating an embodiment of a method for implementing read-write sharing according to the present invention.
As shown in fig. 1, the embodiment of the present invention includes the following steps:
s1, responding to the file to be opened in a read, write or read-write mixed mode, setting a corresponding value for the field value of the opening mode in the handle of the file according to the type of operation and adding a read-write shared identifier;
s2, responding to the successful file opening, sending a request for applying authority to a metadata server side based on the opening mode field value and the read-write sharing identification, and receiving an application result;
s3, responding to the success of the permission application and reading or writing the file, and judging whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and
and S4, responding to the current authority to have read cache authority, write cache authority or read-write sharing authority, and performing cache reading or cache writing on the file.
And responding to the preparation of opening the file in a read, write or read-write mixed mode, setting a corresponding value for an opening mode field value in a handle of the file according to the type of operation, and adding a read-write shared identifier.
The method comprises the steps of starting a cluster read-write sharing function, supporting High Performance Computing (HPC), expanding a POSIX standard interface, adding a shared identifier O _ RWS, assigning a value of an opening mode field value mode in a file handle fh and adding the read-write shared identifier O _ RWS when a client opens a file in a read, write or read-write mixed mode, wherein a permission field is represented by a character 'S'.
And responding to the successful file opening, sending a request for applying the authority to the metadata server side based on the opening mode field value and the read-write sharing identification, and receiving an application result.
In some embodiments, the sending a request for applying for permission to a metadata server side based on the opening mode field value and the read-write sharing identifier and receiving an application result includes: and recording the field value of the opening mode into a metadata field of a metadata server side file, and returning corresponding authority according to the metadata field and the read-write sharing identification. Sending the sharing identification to the metadata server side in the message attached to the metadata server; the metadata server processes the open file message and records the value of the open mode field into the metadata field mode of the metadata server side file.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: judging whether a client performs read operation and/or write operation on the file currently; and responding to the fact that no client exists at present to carry out read operation and/or write operation on the file, and returning the read cache permission and/or the write cache permission according to the metadata field. For example, when a client a writes a file, the client applies for a corresponding permission to the metadata server, and if no client writes the file currently, the metadata server authorizes the client to read (r), write (w) and read-write caching permission (bc).
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: and in response to the current existence of the client, performing read operation and/or write operation on the file, and recovering the read-write sharing permission and the read-cache permission and/or the write-cache permission of the client.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: and responding to the completion of the recovery permission, and returning the read-write sharing permission and the read caching permission and/or the write caching permission based on the metadata field. For example, when a client B is reading or writing the file, the metadata server recovers the read-write caching right (bc) and the authorized read-write sharing right (S) of the client B, and authorizes the write (w) and the read-write sharing right (S) to the current client a. When the client C reads the file, if other clients D are writing the file at the moment, the metadata server recovers the read-write cache authority (bc) and the authorized read-write sharing authority (S) of the client D, and after the other clients are successfully updated, the metadata server authorizes the read authority (r) and the authorized read-write sharing authority (S) to the current client C.
In some embodiments, the method further comprises: and in response to receiving a request for recovering the read-write sharing permission or recovering the write cache permission, printing the data in the cache to a storage medium and then releasing the corresponding permission. When the client receives the metadata server to recover the write cache authority or the read-write sharing authority, the client prints the data in the cache into the storage medium and then releases the corresponding authority.
In some embodiments, the method further comprises: and responding to the received request for recovering the read-write sharing permission or recovering the read cache permission, and releasing the corresponding permission after invalidating the data in the cache. When the client receives the metadata server to recycle the read cache authority or the read-write sharing authority, the client sets the data in the local cache as invalid and then releases the corresponding authority. The read-write sharing function is realized through the authorization and recovery operation of the cache authority or the read-write sharing authority, and the mixed read-write performance of the single file is improved.
And responding to the success of the permission application and reading or writing the file, and judging whether the current permission has read cache permission, write cache permission or read-write sharing permission. And responding to the current authority to read the cache authority, write the cache authority or read-write sharing authority, and performing cache reading or cache writing on the file. After the client applies for the permission, when the read cache permission or the read-write sharing permission exists, the data can be read through cache, the read-write performance is improved, otherwise, the data is read through a direct read mode.
The following describes embodiments of the present invention through a client and a metadata server, respectively:
running a distributed system and a client program at a client, starting a read-write sharing function and an extended POSIX standard interface, and adding a sharing identifier O _ RWS; when a client opens a file in a read, write or read-write mixed mode, a read-write shared identifier O _ RWS is added to an opening mode field value mode in a file handle fh, the identifier is attached to a message sent to a metadata server and is sent to the metadata server, and after the file is opened successfully, the client applies corresponding authority to the metadata server when the client reads/writes/reads/writes the file in a mixed mode; waiting for the metadata server to return an authority application result; after the authority application is successful, when reading/writing is carried out, if the read-write cache authority or the read-write sharing authority is held, carrying out cache reading or writing, and if the read-write cache authority or the read-write sharing authority is not held, carrying out direct reading or direct writing operation; when the client receives the metadata server to recover the write cache authority or the read-write sharing authority, the client prints the data in the cache into a storage medium and then releases the corresponding authority; when the client receives the metadata server to recycle the read cache or the read-write sharing authority, the client sets the data in the local cache as invalid and then releases the corresponding authority so as to keep the consistency of the data.
The metadata server receives a message that the client opens the file; recording the field value of the opening mode into a metadata field mode of a metadata server side file; carrying out relevant processing of file opening and returning a result to the client; receiving a request of a client for applying for corresponding read/write/mixed read-write permission; if no client writes the file currently, the metadata server authorizes read, write and read-write caching permission to the client; if a client reads or writes the file, recovering the read-write caching permission and the authorized read-write sharing permission of other clients; and after the other client side authorities are updated successfully, authorizing the read authority/write authority and the read-write sharing authority to the current client side, and recording the authority and the write-read sharing authority to the corresponding structure.
In a high-performance scene, shared reading and writing are realized by releasing the requirement of data consistency, a client can integrate data written in small blocks for many times into one-time writing operation and write the data into a storage medium, so that the operation times of the storage medium are reduced, and the writing performance is improved; as for data consistency, the upper layer application is required to call the interface provided by the bottom layer to ensure that open read-write sharing is realized. By means of the read-write sharing technology, the interaction times of the client and the storage medium are reduced, the response capability of the client is improved, and the usability of a distributed system is improved.
The embodiment of the invention improves the synchronous read-write performance by sacrificing strict and standard data consistency. By endowing a shared mark to a file which is shared and read and written, when a plurality of clients read and write the file in a mixed way, when the clients hold read-write cache permission or a shared mark, the clients are allowed to read and write cache, and the upper application program ensures the consistency of data by calling a corresponding data consistency interface function; by releasing the requirement of data consistency, the performance of hybrid reading and writing or simultaneous reading and writing of multiple clients is greatly improved, and the client response capability and the usability of a distributed system are improved.
It should be particularly noted that, the steps in the embodiments of the method for implementing read-write sharing described above may be mutually intersected, replaced, added, or deleted, and therefore, the method for implementing read-write sharing implemented by these reasonable permutation and combination transformations shall also belong to the scope of the present invention, and shall not limit the scope of the present invention to the embodiments.
Based on the above object, a second aspect of the embodiments of the present invention provides a system for implementing read-write sharing, including: the identification module is configured to respond to the preparation of opening a file in a read, write or read-write mixed mode, set a corresponding value for an opening mode field value in a handle of the file according to the type of operation and add a read-write shared identification; the application module is configured to respond to the successful file opening and send a request for applying permission to the metadata server side based on the opening mode field value and the read-write sharing identification and receive an application result; the judging module is configured to respond to success of the permission application and read or write the file, and judge whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and the execution module is configured to respond to the read cache permission, the write cache permission or the read-write sharing permission in the current permission and perform cache reading or cache writing on the file.
In some embodiments, the system further comprises a first recovery module configured to: and in response to receiving a request for recovering the read-write sharing permission or recovering the write cache permission, printing the data in the cache to a storage medium and then releasing the corresponding permission.
In some embodiments, the system further comprises a second recovery module configured to: and responding to the received request for recovering the read-write sharing permission or recovering the read cache permission, and releasing the corresponding permission after invalidating the data in the cache.
In some embodiments, the application module is configured to: and recording the field value of the opening mode into a metadata field of a metadata server side file, and returning corresponding authority according to the metadata field and the read-write sharing identification.
In some embodiments, the application module is configured to: judging whether a client performs read operation and/or write operation on the file currently; and responding to the fact that no client exists at present to carry out read operation and/or write operation on the file, and returning the read cache permission and/or the write cache permission according to the metadata field.
In some embodiments, the application module is configured to: and in response to the current existence of the client, performing read operation and/or write operation on the file, and recovering the read-write sharing permission and the read-cache permission and/or the write-cache permission of the client.
In some embodiments, the application module is configured to: and responding to the completion of the recovery permission, and returning the read-write sharing permission and the read caching permission and/or the write caching permission based on the metadata field.
In view of the above object, a third aspect of the embodiments of the present invention provides a computer device, including: at least one processor; and a memory storing computer instructions executable on the processor, the instructions being executable by the processor to perform the steps of: s1, responding to the file to be opened in a read, write or read-write mixed mode, setting a corresponding value for the field value of the opening mode in the handle of the file according to the type of operation and adding a read-write shared identifier; s2, responding to the successful file opening, sending a request for applying authority to a metadata server side based on the opening mode field value and the read-write sharing identification, and receiving an application result; s3, responding to the success of the permission application and reading or writing the file, and judging whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and S4, responding to the current authority to have read cache authority, write cache authority or read-write sharing authority, and performing cache read or cache write on the file.
In some embodiments, the steps further comprise: and in response to receiving a request for recovering the read-write sharing permission or recovering the write cache permission, printing the data in the cache to a storage medium and then releasing the corresponding permission.
In some embodiments, the steps further comprise: and responding to the received request for recovering the read-write sharing permission or recovering the read cache permission, and releasing the corresponding permission after invalidating the data in the cache.
In some embodiments, the sending a request for applying for permission to a metadata server side based on the opening mode field value and the read-write sharing identifier and receiving an application result includes: and recording the field value of the opening mode into a metadata field of a metadata server side file, and returning corresponding authority according to the metadata field and the read-write sharing identification.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: judging whether a client performs read operation and/or write operation on the file currently; and responding to the fact that no client exists at present to carry out read operation and/or write operation on the file, and returning the read cache permission and/or the write cache permission according to the metadata field.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: and in response to the current existence of the client, performing read operation and/or write operation on the file, and recovering the read-write sharing permission and the read-cache permission and/or the write-cache permission of the client.
In some embodiments, the returning the corresponding right according to the metadata field and the read-write shared identifier includes: and responding to the completion of the recovery permission, and returning the read-write sharing permission and the read caching permission and/or the write caching permission based on the metadata field.
Fig. 2 is a schematic diagram of a hardware structure of an embodiment of the computer device for implementing read-write sharing according to the present invention.
Taking the apparatus shown in fig. 2 as an example, the apparatus includes a processor 201 and a memory 202, and may further include: an input device 203 and an output device 204.
The processor 201, the memory 202, the input device 203 and the output device 204 may be connected by a bus or other means, and fig. 2 illustrates the connection by a bus as an example.
The memory 202, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for implementing read-write sharing in the embodiments of the present application. The processor 201 executes various functional applications and data processing of the server by running the nonvolatile software programs, instructions and modules stored in the memory 202, that is, the method for implementing read-write sharing of the above method embodiments is implemented.
The memory 202 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of a method of implementing read-write sharing, and the like. Further, the memory 202 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, memory 202 may optionally include memory located remotely from processor 201, which may be connected to local modules via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 203 may receive information such as a user name and a password that are input. The output device 204 may include a display device such as a display screen.
One or more program instructions/modules corresponding to the method for implementing read-write sharing are stored in the memory 202, and when being executed by the processor 201, the method for implementing read-write sharing in any of the above-mentioned method embodiments is executed.
Any embodiment of the computer device executing the method for implementing read-write sharing can achieve the same or similar effects as any corresponding method embodiment.
The invention also provides a computer readable storage medium storing a computer program which, when executed by a processor, performs the method as above.
Fig. 3 is a schematic diagram of an embodiment of the computer storage medium for implementing read-write sharing according to the present invention. Taking the computer storage medium as shown in fig. 3 as an example, the computer readable storage medium 3 stores a computer program 31 which, when executed by a processor, performs the method as described above.
Finally, it should be noted that, as one of ordinary skill in the art can appreciate, all or part of the processes in the methods of the above embodiments may be implemented by instructing related hardware by a computer program, and a program for implementing the read-write sharing method may be stored in a computer readable storage medium, and when executed, the program may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (10)

1. A method for realizing read-write sharing is characterized by comprising the following steps:
responding to the preparation of opening a file in a read, write or read-write mixed mode, setting a corresponding value for an opening mode field value in a handle of the file according to the type of operation, and adding a read-write shared identifier;
responding to the successful file opening, sending a request for applying permission to a metadata server side based on the opening mode field value and the read-write sharing identification, and receiving an application result;
responding to the success of the permission application and reading or writing the file, and judging whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and
and responding to the current authority to read the cache authority, write the cache authority or read-write sharing authority, and performing cache reading or cache writing on the file.
2. The method of claim 1, further comprising:
and in response to receiving a request for recovering the read-write sharing permission or recovering the write cache permission, printing the data in the cache to a storage medium and then releasing the corresponding permission.
3. The method of claim 1, further comprising:
and responding to the received request for recovering the read-write sharing permission or recovering the read cache permission, and releasing the corresponding permission after invalidating the data in the cache.
4. The method of claim 1, wherein the sending a request for applying for permission to a metadata server and receiving an application result based on the opening mode field value and the read-write sharing identifier comprises:
and recording the field value of the opening mode into a metadata field of a metadata server side file, and returning corresponding authority according to the metadata field and the read-write sharing identification.
5. The method of claim 4, wherein returning the corresponding permission according to the metadata field and the read-write shared identifier comprises:
judging whether a client performs read operation and/or write operation on the file currently; and
and responding to the fact that no client currently exists to carry out read operation and/or write operation on the file, and returning the read cache permission and/or the write cache permission according to the metadata field.
6. The method of claim 5, wherein returning the corresponding permission according to the metadata field and the read-write shared identifier comprises:
and in response to the current existence of the client, performing read operation and/or write operation on the file, and recovering the read-write sharing permission and the read-cache permission and/or the write-cache permission of the client.
7. The method of claim 6, wherein returning the corresponding right according to the metadata field and the read-write shared identifier comprises:
and responding to the completion of the recovery permission, and returning the read-write sharing permission and the read caching permission and/or the write caching permission based on the metadata field.
8. A system for implementing read-write sharing, comprising:
the identification module is configured to respond to the preparation of opening a file in a read, write or read-write mixed mode, set a corresponding value for an opening mode field value in a handle of the file according to the type of operation and add a read-write shared identification;
the application module is configured to respond to the successful file opening and send a request for applying permission to the metadata server side based on the opening mode field value and the read-write sharing identification and receive an application result;
the judging module is configured to respond to success of the permission application and read or write the file, and judge whether the current permission has a read cache permission, a write cache permission or a read-write sharing permission; and
and the execution module is configured to respond to the read cache permission, the write cache permission or the read-write sharing permission in the current permission and perform cache reading or cache writing on the file.
9. A computer device, comprising:
at least one processor; and
a memory storing computer instructions executable on the processor, the instructions when executed by the processor implementing the steps of the method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 7.
CN202110656287.3A 2021-06-11 2021-06-11 Method, system, equipment and medium for realizing read-write sharing Pending CN113568881A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110656287.3A CN113568881A (en) 2021-06-11 2021-06-11 Method, system, equipment and medium for realizing read-write sharing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110656287.3A CN113568881A (en) 2021-06-11 2021-06-11 Method, system, equipment and medium for realizing read-write sharing

Publications (1)

Publication Number Publication Date
CN113568881A true CN113568881A (en) 2021-10-29

Family

ID=78162012

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110656287.3A Pending CN113568881A (en) 2021-06-11 2021-06-11 Method, system, equipment and medium for realizing read-write sharing

Country Status (1)

Country Link
CN (1) CN113568881A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117591038A (en) * 2024-01-18 2024-02-23 济南浪潮数据技术有限公司 Data access method, device, distributed storage system, equipment and medium
CN117591038B (en) * 2024-01-18 2024-06-11 济南浪潮数据技术有限公司 Data access method, device, distributed storage system, equipment and medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117591038A (en) * 2024-01-18 2024-02-23 济南浪潮数据技术有限公司 Data access method, device, distributed storage system, equipment and medium
CN117591038B (en) * 2024-01-18 2024-06-11 济南浪潮数据技术有限公司 Data access method, device, distributed storage system, equipment and medium

Similar Documents

Publication Publication Date Title
CN110958218B (en) Data transmission method based on multi-network communication and related equipment
CN109739690B (en) Backup method and related products
CN107580032B (en) Data processing method, device and equipment
WO2023016414A1 (en) Credential rotation method, computing device, and storage medium
CN111371809A (en) Server based on reverse proxy architecture and GIS service access control method
CN111698675A (en) Data processing method, device and computer readable storage medium
CN108352995B (en) SMB service fault processing method and storage device
CN114244568B (en) Security access control method, device and equipment based on terminal access behavior
CN111309799A (en) Method, device and system for realizing data merging and storage medium
US10242174B2 (en) Secure information flow
CN112134707B (en) Concurrent access method and device for multiple KERBEROS clusters
CN113568881A (en) Method, system, equipment and medium for realizing read-write sharing
CN111444670A (en) Document annotation method and device, computer equipment and storage medium
CN111274176B (en) Information processing method, electronic equipment, system and storage medium
CN113271364B (en) Sharing system, method, computer device and storage medium of service arrangement data
WO2021233351A1 (en) Data transfer method and device, and terminal and computer-readable storage medium
CN114443216A (en) Cloud platform mirror image management method and management system
CN111596953A (en) Version management system, development data transmission control method and related device
CN109558205B (en) Disk access method and device
CN111638956A (en) Application running method and device and storage medium
CN116708027B (en) Multi-terminal remote cooperative communication method, device, equipment and storage medium
WO2024093170A1 (en) Data processing method and apparatus, device, storage medium, and program product
CN115344423B (en) Backup method, mount recovery method, server, and computer-readable storage medium
US11983713B2 (en) Blockchain transaction privacy protection method and blockchain node device
CN114025013B (en) Information processing method, device and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination