CN111026331A - Request response method, device, equipment and computer readable storage medium - Google Patents

Request response method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN111026331A
CN111026331A CN201911199165.5A CN201911199165A CN111026331A CN 111026331 A CN111026331 A CN 111026331A CN 201911199165 A CN201911199165 A CN 201911199165A CN 111026331 A CN111026331 A CN 111026331A
Authority
CN
China
Prior art keywords
metadata
solid state
request
disk
state disk
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
CN201911199165.5A
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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor Technologies 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201911199165.5A priority Critical patent/CN111026331A/en
Publication of CN111026331A publication Critical patent/CN111026331A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0634Configuration or reconfiguration of storage systems by changing the state or mode of one or more devices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0685Hybrid storage combining heterogeneous device types, e.g. hierarchical storage, hybrid arrays

Abstract

The invention belongs to the technical field of data storage, and discloses a request response method, a request response device, request response equipment and a computer readable storage medium. The method comprises the following steps: if a current solid state disk replacement instruction is received, caching metadata in the current solid state disk to a preset area of a mechanical disk; receiving an access request of an object storage service (OSD), and determining a metadata identifier according to the access request; searching corresponding metadata in the current solid state disk based on the metadata identification; if the corresponding metadata is not found, searching the corresponding metadata in a preset area of the mechanical disc based on the metadata identification; and responding to the access request according to the search result in the preset area of the mechanical disc. By the method, data loss is avoided when a large amount of data is migrated, and the service access performance of the storage system is not influenced.

Description

Request response method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of data storage technologies, and in particular, to a request response method, apparatus, device, and computer-readable storage medium.
Background
In a distributed storage system, when the service life of a Solid State Drive (SSD) is insufficient, the following method is mostly adopted when the SSD disk is replaced: stopping all Object storage services (OSD) using the SSD, then pulling out the SSD disk, inserting a new SSD disk, removing the OSD using the original SSD to store metadata from the cluster, creating a new OSD service by using the new SSD disk, then adding the new OSD into the cluster, and recovering the OSD data through a storage system data reconstruction function so that the OSD recovers normal services.
However, in the prior art, since the SSD stores the OSD metadata persistently, after the SSD is replaced, all the OSDs using the SSD to store the metadata need to be rebuilt because the new SSD does not have the data. Typically one SSD is used by multiple OSDs and the reconstruction lasts for a long time. In this time period, a large amount of data inside the cluster is migrated, which may affect the service access performance of the storage system, and reduce the availability of the storage system.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a request response method, a request response device, request response equipment and a computer readable storage medium, and aims to solve the technical problem that the service access performance of a storage system is influenced when a current solid state disk is replaced in the prior art.
To achieve the above object, the present invention provides a request response method, including the steps of:
if a current solid state disk replacement instruction is received, caching metadata in the current solid state disk to a preset area of a mechanical disk;
receiving an access request of an object storage service (OSD), and determining a metadata identifier according to the access request;
searching corresponding metadata in the current solid state disk based on the metadata identification;
if the corresponding metadata is not found, searching the corresponding metadata in a preset area of the mechanical disc based on the metadata identification;
and responding to the access request according to the search result in the preset area of the mechanical disc.
Preferably, the metadata comprises initial metadata;
after the step of caching the metadata in the current solid state disk to a preset area of a mechanical disk, the method further includes:
judging whether the caching of the initial metadata in the current solid state disk is finished;
if the caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, and the current solid state disk is isolated;
and executing an access data request of the received object storage service OSD, searching metadata according to the access data request, and responding to the access request according to a searching result.
Preferably, the access data request comprises a write data request, the metadata further comprises target metadata, the metadata identification comprises a target metadata identification;
the receiving of the access data request of the object storage service OSD, the metadata searching according to the access data request, and the responding to the access request according to the searching result includes:
receiving a write data request of an object storage service (OSD);
determining a target metadata identifier and target metadata according to the data writing request;
determining a preset area of the mechanical disc according to the target metadata identification;
and caching the target metadata to a preset area of the mechanical disk.
Preferably, the access data request further comprises a read data request, and the metadata identifier further comprises an initial metadata identifier;
the receiving of the access data request of the object storage service OSD, the metadata searching according to the access data request, and the responding to the access request according to the searching result includes:
receiving a data reading request of an object storage service OSD;
determining an initial metadata identifier according to the read data request;
and searching corresponding initial metadata on the mechanical disc according to the initial metadata identification, and responding to the access request according to a searching result.
Preferably, after the step of isolating the current solid state disk, the method further includes:
receiving hard disk replacement completion information, and determining a target solid state hard disk after replacement according to the hard disk replacement completion information;
extracting the initial metadata from the mechanical disc;
caching the initial metadata into a target solid state disk, and invalidating the initial metadata in the mechanical disk;
and executing an access data request of the received object storage service OSD, searching metadata according to the access data request, and responding to the access request according to a searching result.
Preferably, the receiving an access data request of the object storage service OSD, performing metadata search according to the access data request, and responding to the access request according to a search result includes:
receiving a write data request of an object storage service (OSD);
determining the target metadata identification and the target metadata according to the data writing request;
determining the target solid state disk according to the target metadata identifier;
and caching the target metadata to the target solid state disk.
Preferably, the receiving an access data request of the object storage service OSD, performing metadata search according to the access data request, and responding to the access request according to a search result includes:
receiving a data reading request of an object storage service OSD;
determining the initial metadata identification according to the read data request;
and searching corresponding initial metadata in the target solid state disk according to the initial metadata identification, and responding to the access request according to the search result.
Preferably, after the step of caching the metadata in the current solid state disk to the preset area of the mechanical disk, the method further includes:
traversing the initial metadata in the current solid state disk;
taking the traversed initial metadata in the current solid state disk as metadata to be processed;
matching the metadata to be processed in the mechanical disc;
and if the metadata to be processed are matched and consistent in the mechanical disk, judging that the initial metadata cache in the current solid state disk is finished.
Preferably, after the step of matching the metadata to be processed in the mechanical disk, the method further includes:
if the metadata to be processed is not matched and consistent in the mechanical disk, caching the initial metadata in the current solid state disk corresponding to the metadata to be processed into a preset area of the mechanical disk, and returning to the step of reading and traversing the initial metadata in the current solid state disk.
In addition, to achieve the above object, the present invention also provides a request response apparatus, including: the cache module is used for caching the initial metadata in the current solid state disk to a preset area of a mechanical disk if a current solid state disk replacement instruction is received;
the system comprises a receiving module, a processing module and a sending module, wherein the receiving module is used for receiving an access request of an object storage service OSD and determining a target metadata identifier according to the access request;
the searching module is used for searching corresponding initial metadata in the current solid state disk based on the target metadata identification;
a determining module, configured to search for corresponding initial metadata in a preset area of the mechanical disc based on the target metadata identifier if the corresponding initial metadata is not found,
and the response module is used for responding to the access request according to the search result in the preset area of the mechanical disc.
In addition, to achieve the above object, the present invention also provides an electronic device, including: a memory, a processor and a request response program stored on the memory and executable on the processor, the request response program being configured to implement the steps of the request response method as described above.
Furthermore, to achieve the above object, the present invention also provides a computer-readable storage medium having a request response program stored thereon, which when executed by a processor implements the steps of the request response method as described above.
According to the method, if a current solid state disk replacement instruction is received, metadata in a current solid state disk are cached to a preset area of a mechanical disk, then an access request of object storage service OSD is received, a metadata identifier is determined according to the access request, corresponding metadata are searched in the current solid state disk based on the metadata identifier, if the corresponding metadata are not searched, the corresponding metadata are searched in the preset area of the mechanical disk based on the metadata identifier, and the access request is responded according to a search result in the preset area of the mechanical disk. By the method, the service access performance of the storage system is not affected in the replacement process of the current solid state disk, and meanwhile, the data loss in the data transmission process is avoided by caching the metadata in the current solid state disk in the preset area of the mechanical disk in the received current solid state disk replacement instruction.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a request response method according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of a request response method according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of a request response method according to the present invention;
fig. 5 is a block diagram of a first embodiment of a request responding apparatus according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the electronic device may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the electronic device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a request response program.
In the electronic apparatus shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 in the electronic device according to the present invention may be disposed in the electronic device, and the electronic device calls the request response program stored in the memory 1005 through the processor 1001 and executes the request response method provided by the embodiment of the present invention.
An embodiment of the present invention provides a request response method, and referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a request response method according to the present invention.
In this embodiment, the request response method includes the following steps:
step S10: and if the current solid state disk replacement instruction is received, caching the metadata in the current solid state disk to a preset area of the mechanical disk.
It should be noted that, if a current solid state disk replacement instruction is received, whether the current solid state disk meets a replacement condition is determined, if the current solid state disk meets the replacement condition, metadata in the current solid state disk is cached to a preset metadata space in the mechanical disk, and if the current solid state disk does not meet the replacement condition, the determination is performed again within a preset time threshold until the current solid state disk meets the replacement condition, and the metadata in the current solid state disk is automatically cached to the preset metadata space in the mechanical disk.
In addition, it should be understood that the replacement condition may be a cluster state, where the cluster state may be a cluster health state, a busy state and an available capacity state of a service, and the like, and when the current solid state disk meets the cluster health state, the busy state and the available capacity state of the service, the metadata in the current solid state disk is cached to a preset area of a mechanical disk, where the preset area is a preset metadata space created in the mechanical disk in advance.
In addition, it should be understood that after the step of caching the metadata in the current solid state disk to the preset area of the mechanical disk, whether caching of the initial metadata in the current solid state disk is completed is judged, and if caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated and the current solid state disk is isolated;
in addition, it should be noted that the step of verifying the completion of the caching of the initial metadata in the current solid-state disk includes traversing the initial metadata in the current solid-state disk, using the traversed initial metadata in the current solid-state disk as metadata to be processed, performing one-to-one matching on the metadata to be processed in the mechanical disk, if the metadata to be processed is matched and consistent in the mechanical disk, determining that the caching of the initial metadata in the current solid-state disk is completed, when the caching of the initial metadata is completed, invalidating the initial metadata in the current solid-state disk, and if the metadata to be processed is not matched and consistent in the mechanical disk, caching the initial metadata in the current solid-state disk corresponding to the metadata to be processed into a preset area of the mechanical disk, and returning to the step of reading and traversing the initial metadata in the current solid state disk.
In addition, for the convenience of understanding, the SSD device used by the OSD is created as a cache device, the Hard Disk Drive (HDD) device used by the OSD is created as a backend device, and a space is divided in the backend device for storing and using the metadata. In the prior art, when data access requests are received, each data access request has an object data, a metadata and a metadata identifier, the metadata is read and written from the SSD cache device, and the object data is read and written from the space of the HDD back-end device. In the flashing process, the OSD service is still on line, when a data writing request is received, metadata in the data writing request is directly written into a preset metadata space in the HDD rear-end equipment, the metadata corresponding to the SSD cache equipment is invalidated, when a data reading request is received, reading is preferentially carried out from the SSD cache equipment, and if the data reading request is not read, the data reading is carried out from the preset metadata space of the HDD rear-end equipment.
Step S20: receiving an access request of an object storage service (OSD), and determining a metadata identifier according to the access request.
It should be noted that the access request of the object storage service OSD may be a write data request or a read data request, and the metadata identifier is determined according to the write data request and the read data request.
It should be understood that the metadata identifier may be an initial metadata identifier or a target metadata identifier, where the initial metadata identifier is an initial metadata identifier corresponding to metadata that has been cached on a solid state disk or a mechanical disk, the target metadata is metadata and a metadata identifier for receiving a new object storage service OSD, metadata in an un-stored state is used as target metadata, and the target metadata identifier is that the target metadata is in a corresponding state.
In addition, it should be noted that the target metadata and the target metadata identifier may be determined according to the write data request, and the read data request may determine the initial metadata identifier, and search for corresponding initial metadata in the solid state disk or in a preset metadata space of the mechanical disk according to the initial metadata identifier.
Step S30: and searching corresponding metadata in the current solid state disk based on the metadata identification.
It should be noted that the metadata identifier may be an initial metadata identifier or a target metadata identifier, where the initial metadata identifier has corresponding initial metadata, and the target metadata identifier has corresponding target metadata, and the metadata is searched for corresponding metadata in the current solid state disk based on the metadata identifier, and the metadata may be replaced, or the metadata is cached according to a location where the corresponding metadata is searched for by the metadata identifier, or the access request is responded according to a location where the metadata identifier is stored in the corresponding metadata.
Step S40: and if the corresponding metadata is not found, searching the corresponding metadata in a preset area of the mechanical disc based on the metadata identification.
Step S50: and responding to the access request according to the search result in the preset area of the mechanical disc.
Furthermore, it should be noted that the access data request includes a write data request, the metadata further includes target metadata, and the metadata identifier includes a target metadata identifier.
It should be understood that if the caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, the current solid state disk is isolated, but the solid state disk is not replaced, and meanwhile, a write data request of an object storage service OSD is not affected, a target metadata identifier and target metadata are determined according to the write data request, a preset region of the mechanical disk is determined according to the target metadata identifier, the target metadata is cached to the preset region of the mechanical disk, a read data request is not affected while the write data request is performed, the access data request further includes a read data request, the metadata identifier further includes an initial metadata identifier, a read data request of the object storage service OSD is received, and the initial metadata identifier is determined according to the read data request, and searching corresponding initial metadata on the mechanical disc according to the initial metadata identification, and responding to the access request according to a searching result.
In addition, it should be noted that if caching of initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, the current solid state disk is isolated, hard disk replacement completion information is received, a target solid state disk after replacement is determined according to the hard disk replacement completion information, the initial metadata is extracted from the mechanical disk, the initial metadata is all metadata in the mechanical disk, the initial metadata is cached in the target solid state disk, the initial metadata in the mechanical disk is invalidated, an access data request of the storage service OSD of the receiving object is executed, metadata is searched according to the access data request, and the access request is responded according to a search result.
Furthermore, it should be understood that the above-described requests for access to data to perform the OSD of the received object storage service, the step of performing a metadata lookup based on the access data request and responding to the access request based on the lookup result includes receiving a write data request of an object storage service OSD, determining the target metadata identification and the target metadata according to the data writing request, determining the target solid state disk according to the target metadata identification, caching the target metadata to the target solid state disk, when writing data, the OSD reading request of the object storage service can be received, and determining the initial metadata identification according to the read data request, searching corresponding initial metadata in the target solid state disk according to the initial metadata identification, and responding to the access request according to a search result.
In addition, for convenience of understanding, the following description illustrates that caching the initial metadata in the current solid state disk to a preset metadata space of the mechanical disk backend device is completed, the SSD cache device is isolated, the metadata is read from and written to the metadata space of the HDD backend device, and the object data is read from and written to the object data space of the HDD backend device. The OSD data reading and writing does not access the SSD equipment any longer, and the SSD equipment can be separated from the back-end equipment of the OSD; after inserting a new SSD disk, establishing the SSD disk as a new cache device, binding the SSD disk to OSD rear-end equipment, loading OSD metadata into the cache device from the rear-end equipment, displaying a loading progress and a predicted required time by a management program according to the data volume to be loaded and the loading speed, and waiting for the completion of loading, thereby recovering the reading and writing of the OSD metadata from the SSD cache device, and the object data of the OSD still being read and written from the HDD rear-end equipment.
In this embodiment, if a current solid state disk replacement instruction is received, caching metadata in a current solid state disk to a preset area of a mechanical disk, isolating the current solid state disk, then receiving a write data request of an object storage service OSD, determining a target metadata identifier and target metadata according to the write data request, determining the preset area of the mechanical disk according to the target metadata identifier, caching the target metadata to the preset area of the mechanical disk, meanwhile, also receiving a read data request of the object storage service OSD, determining an initial metadata identifier according to the read data request, searching corresponding initial metadata in the mechanical disk according to the initial metadata identifier, and responding to the access request according to a search result, so as to avoid data loss during cache data transmission, and meanwhile, when the current solid state disk is isolated, the access request of data is not influenced.
Referring to fig. 3, fig. 3 is a flowchart illustrating a request response method according to a second embodiment of the present invention.
Based on the first embodiment, after step S10, the request response method of this embodiment further includes:
step S101: and judging whether the caching of the initial metadata in the current solid state disk is finished.
It should be noted that, the specific step of determining whether the caching of the initial metadata in the current solid state disk is completed may be to traverse the initial metadata in the current solid state disk, use the traversed initial metadata in the current solid state disk as metadata to be processed, match the metadata to be processed in the mechanical disk, and determine that the caching of the initial metadata in the current solid state disk is completed if the metadata to be processed is matched in the mechanical disk consistently.
In addition, it should be understood that, the above-mentioned matching and consistency of the to-be-processed metadata in the mechanical disk means that the traversed to-be-processed metadata is matched with initial metadata cached in the mechanical disk before, and whether the to-be-processed metadata is consistent with the initial metadata is determined.
In addition, it should be noted that whether caching is completed may also be determined by reading the initial metadata in the mechanical disk by using the to-be-processed metadata identifier of the to-be-processed metadata.
In addition, another method for judging whether the cache is completed is to search the corresponding initial metadata in the mechanical disk according to the initial metadata identifier of the initial metadata in the current solid state disk, and judge whether the search is successful, thereby judging whether the cache is completed.
Step S102: and if the caching of the initial metadata in the current solid state disk is finished, the initial metadata in the current solid state disk is invalidated, and the current solid state disk is isolated.
It should be understood that, corresponding initial metadata is searched in the mechanical disk according to the initial metadata identifier of the initial metadata in the current solid-state disk, if the corresponding initial metadata can be completely searched in the mechanical disk, it is determined that the caching of the initial metadata in the current solid-state disk is successful, if the corresponding initial metadata is not found, the initial metadata in the current solid-state disk is cached in the mechanical disk again, and whether the caching is completed is determined.
In addition, it should be noted that in another determination manner for traversing the initial metadata, if the metadata to be processed is not matched and consistent in the mechanical hard disk, the initial metadata in the current solid-state hard disk corresponding to the metadata to be processed is cached in a preset area of the mechanical hard disk, and the step of performing read traversal on the initial metadata in the current solid-state hard disk is returned.
In addition, it should be noted that all the initial metadata in the current solid state disk are cached in the mechanical disk, and the initial metadata in the current solid state disk is invalidated, that is, the initial metadata in the current solid state disk cannot respond, and then the current solid state disk is isolated, and any data operation cannot be performed subsequently.
Step S103: and executing an access data request of the received object storage service OSD, searching metadata according to the access data request, and responding to the access request according to a searching result.
In addition, it should be noted that the access data request includes a write data request and a read data request, the metadata further includes initial metadata and target metadata, and the metadata identifier includes an initial metadata identifier and a target metadata identifier.
In addition, it should be understood that after the current solid state disk is isolated, the access request of other data is not affected, a write data request of an object storage service OSD is received, a target metadata identifier and target metadata are determined according to the write data request, a preset area of the mechanical hard disk is determined according to the target metadata identifier, and the target metadata is cached to the preset area of the mechanical hard disk.
In addition, it should be noted that after the current solid state disk is isolated, the access request of other data is not affected, a read data request of an object storage service OSD is received, an initial metadata identifier is determined according to the read data request, corresponding initial metadata is searched for in the mechanical hard disk according to the initial metadata identifier, and the access request is responded according to a search result.
In addition, it should be noted that the step of responding to the access request according to the search result is to respond to the initial metadata and execute a corresponding operation if the search of the corresponding initial metadata in the mechanical disk is successful.
In this embodiment, by judging whether the caching of the initial metadata in the current solid state disk is completed, if the caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, the current solid state disk is isolated, the access data request of the storage service OSD of the received object is executed, the metadata is searched according to the access data request, and the access request is responded according to the search result, and in the above manner, after the current solid state disk is isolated, the access requests of other data are not affected, so that the availability of other storage systems is also improved.
Referring to fig. 4, fig. 4 is a flowchart illustrating a request response method according to a third embodiment of the present invention.
Based on the second embodiment, after the step S102, the request responding method of this embodiment further includes:
step S1021: and receiving hard disk replacement completion information, and determining a target solid state disk after replacement according to the hard disk replacement completion information.
It should be noted that, according to a user instruction, hard disk replacement completion information is received, the current solid state disk is replaced with a new current solid state disk according to the hard disk replacement completion information, and the new current solid state disk is used as a target solid state disk.
Step S1022: extracting the initial metadata from the mechanical hard disk.
It should be noted that, when a new current solid state disk, that is, a target solid state disk is replaced, all initial metadata need to be acquired from a preset area in a mechanical disk, and then the initial metadata is cached in the target solid state disk again, and other data access requests are not affected in the process of caching data after replacement is completed.
It should be understood that the preset area is a preset meta space provided for the mechanical disc, the preset meta space is information for storing metadata,
step S1023: caching the initial metadata into a target solid state disk, and invalidating the initial metadata in the mechanical hard disk.
It should be noted that after the step of caching the initial metadata in the target solid state disk, whether caching is completed is determined.
In addition, it should be understood that the step of determining whether caching is completed includes searching for corresponding initial metadata in the target solid state disk according to an initial metadata identifier of the initial metadata in the mechanical disk, determining that caching of the initial metadata in the mechanical disk is successful if the corresponding initial metadata can be completely searched in the mechanical disk, and re-caching the initial metadata in the mechanical disk into the target solid state disk if the corresponding initial metadata is not found, and returning to re-determine whether caching is completed.
Step S1024: and executing an access data request of the received object storage service OSD, searching metadata according to the access data request, and responding to the access request according to a searching result.
It should be noted that, in the process of replacing the target solid state disk with the target solid state disk and caching the initial metadata in the mechanical disk into the target solid state disk, the access request of other data is not affected, for example, a write data request of an object storage service OSD is received, the target metadata identifier and the target metadata are determined according to the write data request, the target solid state disk is determined according to the target metadata identifier, the target metadata is cached into the target solid state disk, or a read data request of the object storage service OSD is received, the initial metadata identifier is determined according to the read data request, corresponding initial metadata is searched in the target solid state disk according to the initial metadata identifier, and the access request is responded according to the search result.
In addition, it should be noted that, the above description may be performed for the write data request and the read data request simultaneously, or performed for the write data request and the read data request separately, and the embodiment is not limited thereto.
According to the method, the initial metadata in the mechanical disk is cached again in the target solid state disk to avoid long-time mass data migration caused by data loss and cluster data reconstruction, meanwhile, the access performance of other data is not influenced while data are cached, and the reliability of a storage system is improved.
Furthermore, an embodiment of the present invention further provides a computer-readable storage medium, where a request response program is stored on the computer-readable storage medium, and when executed by a processor, the request response program implements the steps of the request response method as described above.
Referring to fig. 5, fig. 5 is a block diagram illustrating a first embodiment of a request responding apparatus according to the present invention.
As shown in fig. 5, the request response apparatus according to the embodiment of the present invention includes: the cache module 4001 is configured to cache initial metadata in a current solid state disk to a preset area of a mechanical disk if a current solid state disk replacement instruction is received; a receiving module 4002, configured to receive an access request of an object storage service OSD, and determine a target metadata identifier according to the access request; a searching module 4003, configured to search for corresponding initial metadata in the current solid state disk based on the target metadata identifier; a determining module 4004, configured to search, based on the target metadata identifier, for corresponding initial metadata in a preset area of the mechanical disc if the corresponding initial metadata is not found, and a responding module 4005, configured to respond to the access request according to a search result in the preset area of the mechanical disc.
And if the cache module 4001 receives a current solid state disk replacement instruction, caching the initial metadata in the current solid state disk to a preset area of the mechanical disk.
It should be noted that, if a current solid state disk replacement instruction is received, whether the current solid state disk meets a replacement condition is determined, if the current solid state disk meets the replacement condition, metadata in the current solid state disk is cached to a preset metadata space in the mechanical disk, and if the current solid state disk does not meet the replacement condition, the determination is performed again within a preset time threshold until the current solid state disk meets the replacement condition, and the metadata in the current solid state disk is automatically cached to the preset metadata space in the mechanical disk.
In addition, it should be understood that the replacement condition may be a cluster state, where the cluster state may be a cluster health state, a busy state and an available capacity state of a service, and the like, and when the current solid state disk meets the cluster health state, the busy state and the available capacity state of the service, the metadata in the current solid state disk is cached to a preset area of a mechanical disk, where the preset area is a preset metadata space created in the mechanical disk in advance.
In addition, it should be understood that after the step of caching the metadata in the current solid state disk to the preset area of the mechanical disk, whether caching of the initial metadata in the current solid state disk is completed is judged, and if caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated and the current solid state disk is isolated;
in addition, it should be noted that the step of verifying the completion of the caching of the initial metadata in the current solid-state disk includes traversing the initial metadata in the current solid-state disk, using the traversed initial metadata in the current solid-state disk as metadata to be processed, performing one-to-one matching on the metadata to be processed in the mechanical disk, if the metadata to be processed is matched and consistent in the mechanical disk, determining that the caching of the initial metadata in the current solid-state disk is completed, when the caching of the initial metadata is completed, invalidating the initial metadata in the current solid-state disk, and if the metadata to be processed is not matched and consistent in the mechanical disk, caching the initial metadata in the current solid-state disk corresponding to the metadata to be processed into a preset area of the mechanical disk, and returning to the step of reading and traversing the initial metadata in the current solid state disk.
In addition, for the convenience of understanding, the SSD device used by the OSD is created as a cache device, the Hard Disk Drive (HDD) device used by the OSD is created as a backend device, and a space is divided in the backend device for storing and using the metadata. In the prior art, when data access requests are received, each data access request has an object data, a metadata and a metadata identifier, the metadata is read and written from the SSD cache device, and the object data is read and written from the space of the HDD back-end device. In the flashing process, the OSD service is still on line, when a data writing request is received, metadata in the data writing request is directly written into a preset metadata space in the HDD rear-end equipment, the metadata corresponding to the SSD cache equipment is invalidated, when a data reading request is received, reading is preferentially carried out from the SSD cache equipment, and if the data reading request is not read, the data reading is carried out from the preset metadata space of the HDD rear-end equipment.
The receiving module 4002 receives an access request of an object storage service OSD, and determines an operation of a target metadata identifier according to the access request.
It should be noted that the access request of the object storage service OSD may be a write data request or a read data request, and the metadata identifier is determined according to the write data request and the read data request.
It should be understood that the metadata identifier may be an initial metadata identifier or a target metadata identifier, where the initial metadata identifier is an initial metadata identifier corresponding to metadata that has been cached on a solid state disk or a mechanical disk, the target metadata is metadata and a metadata identifier for receiving a new object storage service OSD, metadata in an un-stored state is used as target metadata, and the target metadata identifier is that the target metadata is in a corresponding state.
In addition, it should be noted that the target metadata and the target metadata identifier may be determined according to the write data request, and the read data request may determine the initial metadata identifier, and search for corresponding initial metadata in the solid state disk or in a preset metadata space of the mechanical disk according to the initial metadata identifier.
The searching module 4003 searches for corresponding initial metadata in the current solid state disk based on the target metadata identifier.
It should be noted that the metadata identifier may be an initial metadata identifier or a target metadata identifier, where the initial metadata identifier has corresponding initial metadata, and the target metadata identifier has corresponding target metadata, and the metadata is searched for corresponding metadata in the current solid state disk based on the metadata identifier, and the metadata may be replaced, or the metadata is cached according to a location where the corresponding metadata is searched for by the metadata identifier, or the access request is responded according to a location where the metadata identifier is stored in the corresponding metadata.
And if the corresponding initial metadata is not found by the determining module 4004, finding the corresponding initial metadata in a preset area of the mechanical disc based on the target metadata identification.
The response module 4005 responds to the access request according to a search result in a preset area of the mechanical disc.
Furthermore, it should be noted that the access data request includes a write data request, the metadata further includes target metadata, and the metadata identifier includes a target metadata identifier.
It should be understood that if the caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, the current solid state disk is isolated, but the solid state disk is not replaced, and meanwhile, a write data request of an object storage service OSD is not affected, a target metadata identifier and target metadata are determined according to the write data request, a preset region of the mechanical disk is determined according to the target metadata identifier, the target metadata is cached to the preset region of the mechanical disk, a read data request is not affected while the write data request is performed, the access data request further includes a read data request, the metadata identifier further includes an initial metadata identifier, a read data request of the object storage service OSD is received, and the initial metadata identifier is determined according to the read data request, and searching corresponding initial metadata on the mechanical disc according to the initial metadata identification, and responding to the access request according to a searching result.
In addition, it should be noted that if caching of initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, the current solid state disk is isolated, hard disk replacement completion information is received, a target solid state disk after replacement is determined according to the hard disk replacement completion information, the initial metadata is extracted from the mechanical disk, the initial metadata is all metadata in the mechanical disk, the initial metadata is cached in the target solid state disk, the initial metadata in the mechanical disk is invalidated, an access data request of the storage service OSD of the receiving object is executed, metadata is searched according to the access data request, and the access request is responded according to a search result.
Furthermore, it should be understood that the above-described requests for access to data to perform the OSD of the received object storage service, the step of performing a metadata lookup based on the access data request and responding to the access request based on the lookup result includes receiving a write data request of an object storage service OSD, determining the target metadata identification and the target metadata according to the data writing request, determining the target solid state disk according to the target metadata identification, caching the target metadata to the target solid state disk, when writing data, the OSD reading request of the object storage service can be received, and determining the initial metadata identification according to the read data request, searching corresponding initial metadata in the target solid state disk according to the initial metadata identification, and responding to the access request according to a search result.
In addition, for convenience of understanding, the following description illustrates that caching the initial metadata in the current solid state disk to a preset metadata space of the mechanical disk backend device is completed, the SSD cache device is isolated, the metadata is read from and written to the metadata space of the HDD backend device, and the object data is read from and written to the object data space of the HDD backend device. The OSD data reading and writing does not access the SSD equipment any longer, and the SSD equipment can be separated from the back-end equipment of the OSD; after inserting a new SSD disk, establishing the SSD disk as a new cache device, binding the SSD disk to OSD rear-end equipment, loading OSD metadata into the cache device from the rear-end equipment, displaying a loading progress and a predicted required time by a management program according to the data volume to be loaded and the loading speed, and waiting for the completion of loading, thereby recovering the reading and writing of the OSD metadata from the SSD cache device, and the object data of the OSD still being read and written from the HDD rear-end equipment.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
In this embodiment, if a current solid state disk replacement instruction is received, caching metadata in a current solid state disk to a preset area of a mechanical disk, isolating the current solid state disk, then receiving a write data request of an object storage service OSD, determining a target metadata identifier and target metadata according to the write data request, determining the preset area of the mechanical disk according to the target metadata identifier, caching the target metadata to the preset area of the mechanical disk, meanwhile, also receiving a read data request of the object storage service OSD, determining an initial metadata identifier according to the read data request, searching corresponding initial metadata in the mechanical disk according to the initial metadata identifier, and responding to the access request according to a search result, so as to avoid data loss during cache data transmission, and meanwhile, when the current solid state disk is isolated, the access request of data is not influenced.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the request response method provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (12)

1. A request response method, the method comprising:
if a current solid state disk replacement instruction is received, caching metadata in the current solid state disk to a preset area of a mechanical disk;
receiving an access request of an object storage service (OSD), and determining a metadata identifier according to the access request;
searching corresponding metadata in the current solid state disk based on the metadata identification;
if the corresponding metadata is not found, searching the corresponding metadata in a preset area of the mechanical disc based on the metadata identification;
and responding to the access request according to the search result in the preset area of the mechanical disc.
2. The method of claim 1, wherein the metadata comprises initial metadata;
after the step of caching the metadata in the current solid state disk to a preset area of a mechanical disk, the method further includes:
judging whether the caching of the initial metadata in the current solid state disk is finished;
if the caching of the initial metadata in the current solid state disk is completed, the initial metadata in the current solid state disk is invalidated, and the current solid state disk is isolated;
and executing an access data request of the received object storage service OSD, searching metadata according to the access data request, and responding to the access request according to a searching result.
3. The method of claim 2, wherein the access data request comprises a write data request, the metadata further comprising target metadata, the metadata identification comprising a target metadata identification;
the receiving of the access data request of the object storage service OSD, the metadata searching according to the access data request, and the responding to the access request according to the searching result includes:
receiving a write data request of an object storage service (OSD);
determining a target metadata identifier and target metadata according to the data writing request;
determining a preset area of the mechanical disc according to the target metadata identification;
and caching the target metadata to a preset area of the mechanical disk.
4. The method of claim 2, wherein the access data request further comprises a read data request, the metadata identification further comprises an initial metadata identification;
the receiving of the access data request of the object storage service OSD, the metadata searching according to the access data request, and the responding to the access request according to the searching result includes:
receiving a data reading request of an object storage service OSD;
determining an initial metadata identifier according to the read data request;
and searching corresponding initial metadata on the mechanical disc according to the initial metadata identification, and responding to the access request according to a searching result.
5. The method of claim 2, wherein after the step of isolating the current solid state disk, further comprising:
receiving hard disk replacement completion information, and determining a target solid state hard disk after replacement according to the hard disk replacement completion information;
extracting the initial metadata from the mechanical disc;
caching the initial metadata into a target solid state disk, and invalidating the initial metadata in the mechanical disk;
and executing an access data request of the received object storage service OSD, searching metadata according to the access data request, and responding to the access request according to a searching result.
6. The method of claim 5, wherein the step of receiving an access data request of an object storage service OSD, performing a metadata lookup based on the access data request, and responding to the access request based on a lookup result comprises:
receiving a write data request of an object storage service (OSD);
determining the target metadata identification and the target metadata according to the data writing request;
determining the target solid state disk according to the target metadata identifier;
and caching the target metadata to the target solid state disk.
7. The method of claim 5, wherein the step of receiving an access data request of an object storage service OSD, performing a metadata lookup based on the access data request, and responding to the access request based on a lookup result comprises:
receiving a data reading request of an object storage service OSD;
determining the initial metadata identification according to the read data request;
and searching corresponding initial metadata in the target solid state disk according to the initial metadata identification, and responding to the access request according to the search result.
8. The method according to any one of claims 1 to 7, wherein after the step of caching the metadata in the current solid state disk to a preset area of the mechanical disk, the method further comprises:
traversing the initial metadata in the current solid state disk;
taking the traversed initial metadata in the current solid state disk as metadata to be processed;
matching the metadata to be processed in the mechanical disc;
and if the metadata to be processed are matched and consistent in the mechanical disk, judging that the initial metadata cache in the current solid state disk is finished.
9. The method of claim 8, wherein the step of matching the metadata to be processed in the mechanical disk is followed by:
if the metadata to be processed is not matched and consistent in the mechanical disk, caching the initial metadata in the current solid state disk corresponding to the metadata to be processed into a preset area of the mechanical disk, and returning to the step of reading and traversing the initial metadata in the current solid state disk.
10. A request response apparatus, characterized in that the apparatus comprises:
the cache module is used for caching the initial metadata in the current solid state disk to a preset area of a mechanical disk if a current solid state disk replacement instruction is received;
the system comprises a receiving module, a processing module and a sending module, wherein the receiving module is used for receiving an access request of an object storage service OSD and determining a target metadata identifier according to the access request;
the searching module is used for searching corresponding initial metadata in the current solid state disk based on the target metadata identification;
a determining module, configured to search for corresponding initial metadata in a preset area of the mechanical disc based on the target metadata identifier if the corresponding initial metadata is not found,
and the response module is used for responding to the access request according to the search result in the preset area of the mechanical disc.
11. An electronic device, characterized in that the device comprises: a memory, a processor and a request response program stored on the memory and executable on the processor, the request response program being configured to implement the steps of the request response method of any of claims 1 to 9.
12. A computer-readable storage medium, having stored thereon a request response program which, when executed by a processor, implements the steps of the request response method according to any one of claims 1 to 9.
CN201911199165.5A 2019-11-28 2019-11-28 Request response method, device, equipment and computer readable storage medium Pending CN111026331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911199165.5A CN111026331A (en) 2019-11-28 2019-11-28 Request response method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911199165.5A CN111026331A (en) 2019-11-28 2019-11-28 Request response method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN111026331A true CN111026331A (en) 2020-04-17

Family

ID=70207274

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911199165.5A Pending CN111026331A (en) 2019-11-28 2019-11-28 Request response method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111026331A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800497A (en) * 2020-06-30 2020-10-20 北京金山云网络技术有限公司 Request response method, and hot migration system and device
CN111913661A (en) * 2020-07-29 2020-11-10 北京天融信网络安全技术有限公司 Cache device replacement method and electronic device
CN113282580A (en) * 2021-04-28 2021-08-20 青岛海尔科技有限公司 Method, storage medium and server for executing timed task

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066808A1 (en) * 2009-09-08 2011-03-17 Fusion-Io, Inc. Apparatus, System, and Method for Caching Data on a Solid-State Storage Device
CN106708433A (en) * 2016-12-06 2017-05-24 深圳市深信服电子科技有限公司 Read-write method and device for stored data
CN109032513A (en) * 2018-07-16 2018-12-18 山东大学 Based on the RAID framework of SSD and HDD and its backup, method for reconstructing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110066808A1 (en) * 2009-09-08 2011-03-17 Fusion-Io, Inc. Apparatus, System, and Method for Caching Data on a Solid-State Storage Device
CN106708433A (en) * 2016-12-06 2017-05-24 深圳市深信服电子科技有限公司 Read-write method and device for stored data
CN109032513A (en) * 2018-07-16 2018-12-18 山东大学 Based on the RAID framework of SSD and HDD and its backup, method for reconstructing

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111800497A (en) * 2020-06-30 2020-10-20 北京金山云网络技术有限公司 Request response method, and hot migration system and device
CN111913661A (en) * 2020-07-29 2020-11-10 北京天融信网络安全技术有限公司 Cache device replacement method and electronic device
CN111913661B (en) * 2020-07-29 2023-07-04 北京天融信网络安全技术有限公司 Cache equipment replacement method and electronic equipment
CN113282580A (en) * 2021-04-28 2021-08-20 青岛海尔科技有限公司 Method, storage medium and server for executing timed task

Similar Documents

Publication Publication Date Title
US11003625B2 (en) Method and apparatus for operating on file
CN107832100B (en) APK plug-in loading method and terminal thereof
CN111026331A (en) Request response method, device, equipment and computer readable storage medium
US11296940B2 (en) Centralized configuration data in a distributed file system
CN105760199B (en) A kind of application resource loading method and its equipment
CN107481762B (en) Trim processing method and device of solid state disk
US11687488B2 (en) Directory deletion method and apparatus, and storage server
CN110888837B (en) Object storage small file merging method and device
CN107329704B (en) Cache mirroring method and controller
CN108475201B (en) Data acquisition method in virtual machine starting process and cloud computing system
CN106294387B (en) Data migration method and device
CN111198856A (en) File management method and device, computer equipment and storage medium
CN105867962A (en) System upgrading method and device
CN108205559B (en) Data management method and equipment thereof
CN110941516B (en) Operating system restoration method, device, equipment and storage medium
CN106844406B (en) Search method and search device
CN115934354A (en) Online storage method and device
CN111831691A (en) Data reading and writing method and device, electronic equipment and storage medium
CN113986471A (en) Method, device, equipment and storage medium for safely deleting mirror image file of virtual machine
CN111126604B (en) Model training method, device, server and storage medium
CN114089912A (en) Data processing method and device based on message middleware and storage medium
US20160232166A1 (en) Method and Apparatus for Accessing File
CN112162949A (en) File management method, system, electronic equipment and storage medium
CN110019031B (en) File creation method and file management device
CN114675776A (en) Resource storage method and device, storage medium and electronic 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