A method, apparatus, device, and storage medium for replacing cache disks.

By saving metadata when the SSD wear reaches a threshold and using the original main storage device to build a new cache disk, the problem of large data reconstruction volume and high risk during cache disk replacement is solved, and a faster and safer data reconstruction process is achieved.

CN115328407BActive Publication Date: 2026-04-21LANGCHAO ELECTRONIC INFORMATION IND CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
LANGCHAO ELECTRONIC INFORMATION IND CO LTD
Filing Date
2022-08-30
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

In the ICFS distributed storage system, replacing the cache disk presents problems such as large data reconstruction volume, long cycle and high risk. Especially when the SSD wear reaches a certain threshold, the existing solution will lead to data loss and storage cluster failure domain.

Method used

When the SSD wear level reaches a preset threshold, the metadata information of the original cache disk DB partition is saved. The target cache disk is established using the original main storage device and metadata information. After replacing the SSD with a new one, the dirty data and new data modified by business increments are reconstructed to reduce the amount of data reconstructed and reduce the risk.

Benefits of technology

By reducing the amount of data to be reconstructed and accelerating the reconstruction process, the risks during data reconstruction are reduced, ensuring data integrity and the stability of the storage system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115328407B_ABST
    Figure CN115328407B_ABST
Patent Text Reader

Abstract

This application discloses a cache disk replacement method, apparatus, device, and storage medium, relating to the field of data storage technology. The method includes: when the wear of the original solid-state drive (SSD) is detected to have reached a preset threshold, saving the metadata information in the original cache disk's DB partition; replacing the SSD with a new one, and establishing a target cache disk using the original primary storage device and metadata information from the original SSD; starting the target cache disk, reconstructing the dirty data on the original cache disk and the new data generated during the disk replacement operation, thus completing the cache disk replacement. When the original SSD is detected to be nearing the end of its lifespan, the original SSD is replaced, and a target cache disk is created using the original SSD's primary storage device and copied metadata information. Data information in the corresponding DB partition is restored, and the data in the corresponding cache partition is reconstructed from the available copy. By reusing the primary storage device, the amount of data reconstructed is greatly reduced, accelerating the reconstruction speed and reducing the risks during data reconstruction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data storage technology, and in particular to a method, apparatus, device, and storage medium for replacing cache disks. Background Technology

[0002] In recent years, internet companies have been expanding rapidly, with their data volumes increasing daily, leading to a growing demand for data storage capacity. Compared to traditional storage systems, ICFS (Inspur Cluster File System) is gaining popularity due to its excellent cost-effectiveness, flexible fault tolerance, and scalability. In practical storage scenarios, considering both performance and cost, ICFS distributed storage systems use SSDs (Solid State Drives) as caching devices in tiered storage scenarios. This provides storage clients with random write buffering and hotspot data caching to improve read / write performance when HDDs (Hard Disk Drives) are used as primary storage. The flash memory chips on SSDs have a limited number of write cycles, making SSDs, as caching devices, more prone to reaching their lifespan compared to HDDs. By reading the hard drive's SMART information, the wear percentage can be obtained. Based on experience, when the SSD wear percentage reaches 90%, replacement is recommended; when it reaches 95%, the hard drive is considered unreliable and requires immediate replacement. In the original cache lifetime expiration replacement scheme of the ICFS distributed storage system's tiered storage scenario, all OSDs (Object-based Storage Devices) affected by the expiring SSDs need to be set to "out". After inserting new SSD cache disks, OSDs are recreated in conjunction with the previous HDDs, and the original data is reconstructed from OSDs in other normal fault domains. This method discards all data information on the original HDDs. Since a single SSD provides cache partitions for multiple HDDs, when an SSD expires, multiple OSDs need to be reconstructed, resulting in a large amount of data and a long reconstruction period. Furthermore, if other faults occur in the cluster during the reconstruction period, it can easily lead to the storage cluster exceeding its fault domain and data loss.

[0003] In summary, how to achieve cache disk replacement while reducing the amount of data to be reconstructed, thereby accelerating the reconstruction process and mitigating the risks during data reconstruction, is a technical problem that needs to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of this invention is to provide a cache disk replacement method, apparatus, device, and storage medium that can replace the cache disk while reducing the amount of data to be reconstructed, thereby accelerating the reconstruction speed and reducing the risks during data reconstruction. The specific solution is as follows:

[0005] In a first aspect, this application discloses a cache disk replacement method, applied to a distributed object storage system, comprising:

[0006] When the wear of the original solid-state drive device is detected to reach a preset threshold, the metadata information in the original cache disk DB partition is saved.

[0007] Replace the solid-state drive with a new one, and use the original main storage device and metadata information from the original solid-state drive to create the target cache disk;

[0008] Start the target cache disk, reconstruct the dirty data of the original cache disk and the new data generated by the disk swapping operation, and complete the cache disk replacement.

[0009] Optionally, before saving the metadata information in the original cache disk DB partition when the wear of the original solid-state drive device is detected to have reached a preset threshold, the method further includes:

[0010] The wear level of all solid-state drives in the cluster can be queried using a preset wear level query command.

[0011] Optionally, the step of saving the metadata information in the original cache disk DB partition includes:

[0012] The original cache disk DB partition is backed up using a preset backup command, and the metadata information in the original cache disk DB partition is saved to a block device or file.

[0013] Optionally, after replacing the solid-state drive device, the following steps are also included:

[0014] The new solid-state drive (SSD) device is partitioned, and the backed-up metadata information is copied to the DB partition of the new SSD device.

[0015] Optionally, after starting the target cache disk, the method further includes:

[0016] Based on the received deletion parameters, delete the cached data in the metadata information that is used to record in the Cache partition.

[0017] Optionally, the cache disk replacement method further includes:

[0018] A cache disk is constructed based on the aforementioned Cache partition, DB partition, and main storage device.

[0019] Optionally, the reconstruction of the dirty data on the original cache disk and the new data generated during the disk swap operation includes:

[0020] The new cache data in the cache partition of the new cache disk is reconstructed based on the dirty data in the cache disk under normal conditions and the new data modified by the business increment generated by the disk swap operation.

[0021] Secondly, this application discloses a cache disk replacement device, applied to a distributed object storage system, comprising:

[0022] The information storage module is used to save metadata information in the original cache disk DB partition when the wear of the original solid-state drive device is detected to reach a preset threshold.

[0023] The target disk creation module is used to replace the new solid-state drive (SSD) device and create a target cache disk using the original main storage device and metadata information from the original SSD.

[0024] The cache disk replacement module is used to start the target cache disk, reconstruct the dirty data of the original cache disk and the new data generated by the disk replacement operation, and complete the cache disk replacement.

[0025] Thirdly, this application discloses an electronic device, including:

[0026] Memory, used to store computer programs;

[0027] A processor is configured to execute the computer program to implement the steps of the aforementioned disclosed cache disk replacement method.

[0028] Fourthly, this application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the steps of the aforementioned cache disk replacement method.

[0029] Therefore, this application discloses a cache disk replacement method applied to a distributed object storage system, comprising: when the wear of the original solid-state drive (SSD) device is detected to have reached a preset threshold, saving the metadata information in the DB partition of the original cache disk; replacing the original SSD device with a new SSD device, and using the original primary storage device and metadata information in the original SSD to establish a target cache disk; starting the target cache disk, and reconstructing the dirty data of the original cache disk and the new data generated by the disk replacement operation to complete the cache disk replacement. It is evident that by replacing the original SSD when its lifespan is about to expire, and using the primary storage device of the original SSD and the copied metadata information to create a target cache disk, the data information in the corresponding DB partition is restored, without copying the data in the original cache partition. After creating the target cache disk, the data in the corresponding cache partition is reconstructed from other available copies. In this way, by reusing the primary storage device, the amount of data reconstructed is greatly reduced, the reconstruction speed is accelerated, and the risks during data reconstruction are reduced. Attached Figure Description

[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0031] Figure 1 This is a flowchart of a cache disk replacement method disclosed in this application;

[0032] Figure 2 This application discloses an I / O flowchart for an ICFS distributed storage system combined with a caching device.

[0033] Figure 3 This is a flowchart of a specific cache disk replacement method disclosed in this application;

[0034] Figure 4 This is a diagram showing the cache disk configuration of an ICFS distributed hierarchical storage system disclosed in this application;

[0035] Figure 5 This is a schematic diagram of a cache disk replacement device disclosed in this application;

[0036] Figure 6 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0037] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0038] In recent years, internet companies have been expanding rapidly, with their data volumes increasing daily, leading to a growing demand for data storage capacity. Compared to traditional storage systems, ICFS is gaining popularity due to its excellent cost-effectiveness, flexible fault tolerance, and scalability. In practical storage scenarios, considering both performance and cost, ICFS distributed storage systems use SSDs as caching devices in tiered storage scenarios. This provides storage clients with random write buffering and hot data caching functions to improve read / write performance when HDDs are used as primary storage. The flash memory chips on SSDs have a limited number of write cycles, making SSDs, as caching devices, more prone to reaching their lifespan compared to HDDs. By reading the SMART information of the hard drive, the wear percentage can be obtained. Based on experience, when the SSD wear percentage reaches 90%, it is recommended to replace the device; when the wear percentage reaches 95%, the hard drive is considered unreliable and needs immediate replacement. In the original cache lifetime expiration replacement scheme of the ICFS distributed storage system's tiered storage scenario, all OSDs affected by the expiring SSD device need to be set to "out". After inserting a new SSD cache disk, the OSD is recreated in conjunction with the previous HDD device, and the original data is reconstructed from OSDs in other normal states under the fault domain. This method discards all data information on the original HDD device. Since a single SSD provides cache partitions for multiple HDDs, when the SSD's lifetime expires, multiple OSDs need to be reconstructed, resulting in a large amount of data reconstruction and a long cycle. Furthermore, if other failures occur in the cluster during the reconstruction period, it can easily lead to the storage cluster exceeding the fault domain, resulting in data loss.

[0039] Therefore, this application provides a cache disk replacement scheme that can replace the cache disk while reducing the amount of data to be reconstructed, thereby speeding up the reconstruction process and reducing the risks during data reconstruction.

[0040] Reference Figure 1 As shown, this embodiment of the invention discloses a cache disk replacement method, applied to a distributed object storage system, including:

[0041] Step S11: When the wear of the original solid-state drive device is detected to reach a preset threshold, save the metadata information in the original cache disk DB partition.

[0042] In this embodiment, after continuous write and erase operations on the flash memory chips of the original solid-state drive (SSD) in the ICFS distributed object storage system, the original SSD will experience corresponding wear. When the wear of the original SSD reaches a certain threshold, the SSD becomes unreliable and needs to be replaced. It can be understood that when the wear of the original SSD is detected to reach a preset threshold, all affected cache disk daemons are stopped, and the metadata information in the original cache disk's DB partition is saved. For example, when the lifespan of the SSD cache device on the storage node is detected to have expired, and the wear of the SSD cache device is greater than 90%, all affected OSD daemons are stopped, and the metadata information of the DB partitions of all OSDs is saved.

[0043] In this embodiment, before saving the metadata information in the original cache disk DB partition when the wear of the original solid-state drive (SSD) device is detected to have reached a preset threshold, the method further includes: querying the wear of all SSD devices in the cluster using a preset wear query command. It can be understood that, based on historically collected device lifespan information for each SSD device, a wear threshold for the SSD device is predicted. Then, the wear status of the current SSD device is monitored in real time using a monitor. The wear status of all monitored SSD devices is then queried using the preset wear query command. When the wear of the current SSD device is found to be greater than the preset threshold, the wear exceeding the threshold is promptly reported back to the corresponding component so that the component can take appropriate action on the original SSD device based on the wear exceeding the threshold. For example, the wear status of all SSD devices in the cluster is periodically queried using the `smartctl` command, and when it reaches a threshold indicating potential damage, the user is notified to manually replace it.

[0044] In this embodiment, the original cache disk DB partition is backed up using a preset backup command, and the metadata information in the original cache disk DB partition is saved to a block device or file. It can be understood that the dd command is used to back up the DB partitions of these OSDs and save the metadata information in the DB partitions to a block device or file in another location.

[0045] Step S12: Replace the solid-state drive with a new solid-state drive and use the original main storage device and metadata information in the original solid-state drive to create a target cache disk.

[0046] In this embodiment, after replacing the SSD cache disk, the original HDD main memory device and metadata information are reused to recreate the OSD. This means that when replacing an SSD cache disk that has reached the end of its lifespan, the original OSD's DB partition data is retained. When creating a new OSD after replacing the SSD, the original OSD's DB partition data and HDD main memory data are reused. An HHD is a high-capacity storage device that includes both a traditional hard drive and a flash memory module. Flash memory handles the most frequently written or retrieved data. HHD has the following advantages: faster data storage and retrieval in applications such as word processors, reduced system startup time, lower power consumption, less heat generation, and extended hard drive lifespan. However, HHD also has the following disadvantages: longer seek times for data in the hard drive, more frequent hard drive spin changes, inability to recover data if the flash memory module fails, and higher overall system hardware costs. An SSD is a hard drive made of solid-state electronic storage chip arrays, consisting of a control unit and storage units. When creating a new OSD, some data information in the new OSD is constructed based on the original OSD's DB partition metadata information and HDD main memory data. It should be noted that building a cache disk based on the aforementioned cache partition, database partition, and main storage device can be understood as referring to... Figure 2 As shown, in the tiered storage scenario of the original ICFD distributed storage system, SSDs are used as cache devices and HDDs as primary storage devices. When performing a read operation, the cache device is accessed first to retrieve the corresponding read cache and return it to the component that issued the read operation. However, if the corresponding read cache is not found in the cache device during the read operation, the primary storage device is accessed to query the corresponding read cache and the result is returned to the component that issued the read operation. At this time, the cache device will also update the previous read cache synchronously so that the corresponding read cache can be directly provided in the cache device when the same read operation occurs again. When performing a write operation, the cache is written to the cache device so that the cache device can perform a flush operation to refresh the write cache to the primary storage device. In this way, the read and write operation process is realized, improving the business read and write performance when HDD is used as the primary storage.

[0047] Step S13: Start the target cache disk, reconstruct the dirty data of the original cache disk and the new data generated by the disk replacement operation, and complete the cache disk replacement.

[0048] In this embodiment, after the new OSD starts up, the lost dirty data on the cache partition of the original OSD and the new data modified by business increments during disk replacement are reconstructed from OSDs in other normal fault domains. Here, an OSD corresponds to an actual physical disk, and a single ICFS storage cluster consists of multiple OSDs on multiple server nodes. It can be understood that when replacing a cache device with a new SSD before its lifespan expires, the data on the original HDD is retained. Simultaneously, when replacing an SSD cache disk that has reached its end of life, the DB partition data of the original OSD is retained. After replacing the SSD disk and creating a new OSD, the DB partition data and HDD main memory data of the original OSD are reused, and then the lost dirty data on the cache device of the original OSD and the new data modified by business increments during disk replacement are reconstructed from OSDs in other normal fault domains.

[0049] Therefore, this application discloses a cache disk replacement method applied to a distributed object storage system, comprising: when the wear of the original solid-state drive (SSD) device is detected to have reached a preset threshold, saving the metadata information in the DB partition of the original cache disk; replacing the original SSD device with a new SSD device, and using the original primary storage device and metadata information in the original SSD to establish a target cache disk; starting the target cache disk, and reconstructing the dirty data of the original cache disk and the new data generated by the disk replacement operation to complete the cache disk replacement. It is evident that by replacing the original SSD when its lifespan is about to expire, and using the primary storage device of the original SSD and the copied metadata information to create a target cache disk, the data information in the corresponding DB partition is restored, without copying the data in the original cache partition. After creating the target cache disk, the data in the corresponding cache partition is reconstructed from other available copies. In this way, by reusing the primary storage device, the amount of data reconstructed is greatly reduced, the reconstruction speed is accelerated, and the risks during data reconstruction are reduced.

[0050] Reference Figure 3 As shown, this embodiment of the invention discloses a specific method for replacing a cache disk. Compared to the previous embodiment, this embodiment further explains and optimizes the technical solution. Specifically:

[0051] Step S21: When the wear of the original solid-state drive device is detected to reach a preset threshold, save the metadata information in the original cache disk DB partition.

[0052] For a more detailed description of the processing steps in step S21, please refer to the aforementioned disclosed embodiments; they will not be repeated here.

[0053] Step S22: Replace with a new solid-state drive (SSD), perform partitioning operations on the new SSD, and copy the backed-up metadata information to the DB partition on the new SSD.

[0054] In this embodiment, refer to Figure 4 As shown, an OSD consists of an HDD device as main memory, a cache partition as cache, and a DB partition for storing metadata. To improve performance, the cache and DB partitions are separate partitions from the SSD. A single SSD device typically provides cache and DB partitions for multiple OSDs after multiple partitioning processes. In the original cache lifetime replacement scheme, the cluster discards all data on OSDs affected by expired SSDs. After replacing the SSD and recreating the OSD, the lost data is recovered from available replicas in other failure domains. The disadvantages are the large amount of data reconstruction, long cluster degradation time, and high risk. Therefore, after replacing the SSD device, the new OSD is partitioned, and the backed-up metadata information is copied to the corresponding DB partition in the new OSD device.

[0055] Step S23: Use the original main storage device and metadata information in the original solid-state drive to create the target cache disk.

[0056] In this embodiment, the HDD and DB partitions in the new OSD are built using the data in the HDD of the original OSD and the backed-up metadata information. It can be understood that when a dead-end SSD cache disk is removed and a new disk is inserted, the OSD's cache and DB partitions are removed, but the data on the main memory HDD still exists. If the data on the HDD can be recovered, the amount of data to be reconstructed will be greatly reduced. Metadata must be retained to use the data on this HDD. If the OSD daemon can be stopped before replacing the dead-end SSD and its DB partition's metadata can be saved to another location, this data can be reused when the OSD is reconstructed later. In this way, after replacing the SSD and recreating the OSD, only the dirty data on the original OSD's cache partition needs to be reconstructed.

[0057] Step S24: Start the target cache disk and delete the cached data recorded in the Cache partition in the metadata information based on the received deletion parameters.

[0058] In this embodiment, a new OSD is started, and all data previously recorded on the Cache partition is deleted from the metadata information. It can be understood that after the new OSD is started, the data previously recorded on the Cache partition is deleted based on the deletion parameters transmitted before starting the new OSD. This ensures that there is no cached data in the Cache partition, allowing for subsequent automatic data reconstruction operations on the Cache partition.

[0059] Step S25: Reconstruct the new cache data in the Cache partition of the new cache disk based on the dirty data in the cache disk under normal conditions and the new data modified by the business increment generated by the disk swap operation.

[0060] In this embodiment, the lost dirty data on the original OSD's cache partition and the new data modified by business increments during the disk replacement are reconstructed from the OSDs in other normal fault domains. In fact, the data on the cache partition could also be retained before replacing the SSD, but considering that cache partitions are generally large and contain a lot of data, copying requires additional disk space and disk slots. Furthermore, the copying time would be relatively long. During this process, the OSD daemon process stopping would cause the cluster to remain in a degraded state, posing a high risk. Moreover, although the cache partition contains a large amount of data, the amount of dirty data may not be large; it's possible that most of the data on the cache partition is clean data existing on the HDD main memory. Considering all these factors, the new disk replacement scheme only copies the DB partition data of OSDs affected by SSDs whose lifespans have expired.

[0061] Therefore, in this embodiment, partitions are created on the new SSD cache disk, and the backed-up metadata is copied to the prepared DB partition on the new disk. The OSD is recreated using the previous HDD and the new cache disk partition, and parameters are passed to the OSD before startup to notify it to delete all cache data. After the OSD starts, all data recorded in the metadata information on the cache partition is deleted. The lost data is automatically reconstructed incrementally from data replicas in other normal failure domains. After reconstruction, the cluster returns to normal, preserving the data on the original HDD devices and reducing the amount of reconstruction data in the storage cluster.

[0062] Reference Figure 5 As shown, an embodiment of the present invention discloses a specific cache disk replacement device, comprising:

[0063] Information storage module 11 is used to save metadata information in the original cache disk DB partition when the wear of the original solid-state drive device is detected to reach a preset threshold.

[0064] The target disk creation module 12 is used to replace the new solid-state drive device and create a target cache disk using the original main storage device and metadata information in the original solid-state drive.

[0065] The cache disk replacement module 13 is used to start the target cache disk, reconstruct the dirty data of the original cache disk and the new data generated by the disk replacement operation, and complete the cache disk replacement.

[0066] The information storage module 11 is specifically used in the ICFS distributed object storage system to address the wear and tear on the original solid-state drive (SSD) devices after continuous write and erase operations on the flash memory chips. When the wear reaches a certain threshold, the SSD becomes unreliable and needs replacement. Specifically, when the wear of the original SSD reaches a preset threshold, all affected cache disk daemons are stopped, and the metadata information in the original cache disk's DB partition is saved. For example, when the SSD cache device on a storage node reaches its lifespan and its wear exceeds 90%, all affected OSD daemons are stopped, and the metadata information of all OSD's DB partitions is saved. Before saving the metadata information in the original cache disk's DB partition when the wear of the original SSD reaches the preset threshold, the module further includes querying the wear of all SSD devices in the cluster using a preset wear query command. Understandably, based on historically collected device lifespan information for each SSD, the wear threshold of the SSD devices is predicted. Then, the wear status of the current SSD devices is monitored in real time via a monitor. A preset wear query command is used to query the wear status of all monitored SSD devices. When the wear status of a current SSD device exceeds the preset threshold, the excessive wear is promptly reported to the relevant components so that the components can take appropriate action. For example, the `smartctl` command is used to periodically query the wear status of all SSD devices in the cluster, and when it reaches a threshold indicating potential damage, the user is notified to manually replace it. A preset backup command is used to back up the original cache disk's DB partition, and the metadata information in the original cache disk's DB partition is saved to a block device or file. Understandably, the `dd` command is used to back up the DB partitions of these OSDs, and the metadata information in the DB partitions is saved to a block device or file in another location.

[0067] The target disk creation module 12 is specifically used to recreate the OSD after replacing the SSD cache disk with a new one, reusing the original HDD main memory device and metadata information. This means that when replacing an SSD cache disk that has reached the end of its lifespan, the original OSD's DB partition data is retained. When creating a new OSD after replacing the SSD, the original OSD's DB partition data and HDD main memory data are reused. An HHD is a high-capacity storage device that includes both a traditional hard drive and a flash memory module. Flash memory handles the most frequently written or recovered data. HHD has the following advantages: faster data storage and recovery in applications such as word processors, reduced system startup time, lower power consumption, less heat generation, and extended hard drive lifespan. However, HHD also has the following disadvantages: longer seek times for data in the hard drive, more frequent hard drive spin changes, inability to recover data if the flash memory module fails, and higher overall system hardware costs. An SSD is a hard drive made of solid-state electronic storage chip arrays, consisting of a control unit and storage units. When creating a new OSD, some data information in the new OSD is constructed based on the original OSD's DB partition metadata information and HDD main memory data. It should be noted that building a cache disk based on the aforementioned cache partition, database partition, and main storage device can be understood as referring to... Figure 2As shown, in the tiered storage scenario of the original ICFD distributed storage system, SSDs are used as cache devices and HDDs as primary storage devices. When performing a read operation, the cache device is accessed first to retrieve the corresponding read cache and return it to the component that issued the read operation. However, if the corresponding read cache is not found in the cache device during the read operation, the primary storage device is accessed to query the corresponding read cache and the result is returned to the component that issued the read operation. At this time, the cache device also updates its previous read cache so that the corresponding read cache can be directly provided in the cache device for the next read operation. When performing a write operation, the cache is written to the cache device so that the cache device can perform a flush operation to refresh the write cache to the primary storage device. In this way, the read and write operation process is implemented, improving the business read and write performance when HDD is used as primary storage. An OSD consists of an HDD device as primary storage, a Cache partition as cache, and a BD partition for storing metadata. To improve performance, the Cache partition and DB partition are separately partitioned from the SSD. A single SSD device typically provides cache and database partitions for multiple OSDs after multiple partitioning processes. In the original cache lifetime replacement scheme, the cluster discards all data on OSDs affected by the expiring SSDs. After replacing the SSD and recreating the OSDs, the lost data is recovered from available replicas in other failure domains. The disadvantages are the large amount of data reconstruction, long cluster degradation time, and high risk. Therefore, after replacing the SSD device, the new OSD is partitioned, and the backed-up metadata information is copied to the corresponding database partition on the new OSD device.

[0068] The cache disk replacement module 13 is specifically used to reconstruct the lost dirty data on the cache partition of the original OSD and the new data modified by business increments during the disk replacement from OSDs in other normal fault domains after the new OSD starts up. It can be understood that when replacing a cache device with a new SSD cache device before its lifespan expires, the data on the original HDD device is retained. Simultaneously, when replacing an SSD cache disk that has reached the end of its lifespan, the DB partition data of the original OSD is retained. After replacing the new SSD disk and creating a new OSD, the DB partition data and HDD main memory data of the original OSD are reused. Then, the lost dirty data on the cache device of the original OSD and the new data modified by business increments during the disk replacement are reconstructed from OSDs in other normal fault domains. The new OSD's HDD and DB partition are established using the data in the HDD of the original OSD and the backed-up metadata information. It can be understood that when the expired SSD cache disk is removed and a new disk is inserted, the OSD's cache partition and DB partition are removed during the SSD replacement, but the data on the main memory HDD still exists. If the data on the HDD can be recovered, the amount of data to be reconstructed will be greatly reduced. Metadata must be retained to use the data on this HDD. If the OSD daemon can be stopped before replacing the aging SSD and its metadata in the DB partition can be saved to another location, this data can be reused when the OSD is reconstructed later. In this way, after replacing the SSD and recreating the OSD, only the dirty data on the original OSD's CACHE partition needs to be reconstructed. The new OSD is then started, and all data previously recorded on the Cache partition is deleted from the metadata information. Understandably, after starting the new OSD, the data previously recorded on the Cache partition is deleted based on the deletion parameters transferred before starting the new OSD. This ensures that there is no cached data in the Cache partition, allowing for subsequent automatic data reconstruction of the Cache partition. From other OSDs in the faulty domain that are in normal condition, the lost dirty data on the original OSD's Cache partition and the new data incrementally modified during the disk replacement are reconstructed. In fact, the data on the Cache partition could also be retained before replacing the SSD, but considering that the Cache partition is generally large and contains a lot of data, additional disk space and disk slots are required for copying. Additionally, the copying process will take a relatively long time. During this period, the OSD daemon may stop, causing the cluster to remain in a degraded state, which carries a high risk. Furthermore, although the cache partition contains a large amount of data, the amount of dirty data may not be significant; it's possible that most of the data in the cache partition is clean data that already exists on the HDD main memory. Considering all these factors, the new disk replacement solution only copies the DB partition data of OSDs affected by SSDs whose lifespans have expired.

[0069] Therefore, this application discloses a cache disk replacement method applied to a distributed object storage system, comprising: when the wear of the original solid-state drive (SSD) device is detected to have reached a preset threshold, saving the metadata information in the DB partition of the original cache disk; replacing the original SSD device with a new SSD device, and using the original primary storage device and metadata information in the original SSD to establish a target cache disk; starting the target cache disk, and reconstructing the dirty data of the original cache disk and the new data generated by the disk replacement operation to complete the cache disk replacement. It is evident that by replacing the original SSD when its lifespan is about to expire, and using the primary storage device of the original SSD and the copied metadata information to create a target cache disk, the data information in the corresponding DB partition is restored, without copying the data in the original cache partition. After creating the target cache disk, the data in the corresponding cache partition is reconstructed from other available copies. In this way, by reusing the primary storage device, the amount of data reconstructed is greatly reduced, the reconstruction speed is accelerated, and the risks during data reconstruction are reduced.

[0070] In some specific embodiments, the cache disk replacement device may specifically include:

[0071] The wear detection unit is used to query the wear level of all solid-state drive devices in the cluster using a preset wear query command.

[0072] In some specific embodiments, the information storage module 11 may specifically include:

[0073] The original cache disk DB partition is backed up using a preset backup command, and the metadata information in the original cache disk DB partition is saved to a block device or file.

[0074] In some specific embodiments, the cache disk replacement device may specifically include:

[0075] The region partitioning unit is used to perform partitioning operations on the new solid-state drive device and copy the backed-up metadata information to the DB partition in the new solid-state drive device.

[0076] In some specific embodiments, the cache disk replacement device may specifically include:

[0077] The data deletion unit is used to delete cached data recorded in the cache partition from the metadata information based on the received deletion parameters.

[0078] In some specific embodiments, the cache disk replacement device may specifically include:

[0079] The cache disk construction unit is used to construct a cache disk based on the Cache partition, DB partition, and main storage device.

[0080] In some specific embodiments, the cache disk replacement module 13 may specifically include:

[0081] The data reconstruction unit is used to reconstruct new cache data in the cache partition of the new cache disk based on the dirty data in the cache disk under normal conditions and the new data modified by the business increment generated by the disk swap operation.

[0082] Furthermore, embodiments of this application also disclose an electronic device, Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.

[0083] Figure 6 This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the cache disk replacement method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0084] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0085] The processor 21 may include one or more processing cores, such as a quad-core processor or an octa-core processor. The processor 21 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0086] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0087] The operating system 221 manages and controls the various hardware devices and computer programs 222 on the electronic device 20 to enable the processor 21 to perform calculations and processing on the massive amounts of data 223 in the memory 22. The operating system 221 can be Windows Server, Netware, Unix, Linux, etc. The computer program 222, in addition to including a computer program capable of performing the cache disk replacement method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, may further include computer programs capable of performing other specific tasks. The data 223 may include data received by the electronic device from external devices, as well as data collected by its own input / output interface 25.

[0088] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned cache disk replacement method. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0089] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0090] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can implement the described functions using different methods for each specific application, but such implementation should not be considered beyond the scope of this application. The steps of the methods or algorithms described in connection with the embodiments disclosed herein can be implemented directly in hardware, software modules executed by a processor, or a combination of both. Software modules can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disks, removable disks, CD-ROMs, or any other form of storage medium known in the art.

[0091] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0092] The above provides a detailed description of the cache disk replacement method, apparatus, device, and storage medium provided by the present invention. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for replacing a cache disk, characterized in that, Applications in distributed object storage systems include: When the wear of the original solid-state drive device is detected to reach a preset threshold, the metadata information in the original cache disk DB partition is saved. Replace the solid-state drive with a new one, and use the original main storage device and metadata information from the original solid-state drive to create the target cache disk; Start the target cache disk, reconstruct the dirty data on the original cache disk and the new data generated by the disk swapping operation, and complete the cache disk replacement; After starting the target cache disk, the method further includes: Based on the received deletion parameters, delete the cached data in the metadata information that is used to record in the Cache partition; The cache disk replacement method further includes: A cache disk is constructed based on the aforementioned Cache partition, DB partition, and main storage device; The reconstructing of dirty data from the original cache disk and the new data generated during the disk swapping operation include: The new cache data in the cache partition of the new cache disk is reconstructed based on the dirty data in the cache disk under normal conditions and the new data modified by the business increment generated by the disk swap operation; the dirty data is the data that has not been flushed to the main storage device.

2. The cache disk replacement method according to claim 1, characterized in that, Before saving the metadata information in the original cache disk DB partition when the wear of the original solid-state drive device is detected to have reached a preset threshold, the process also includes: The wear level of all solid-state drives in the cluster can be queried using a preset wear level query command.

3. The cache disk replacement method according to claim 1, characterized in that, The metadata information stored in the original cache disk DB partition includes: The original cache disk DB partition is backed up using a preset backup command, and the metadata information in the original cache disk DB partition is saved to a block device or file.

4. The cache disk replacement method according to claim 1, characterized in that, After replacing the solid-state drive device, the following is also included: The new solid-state drive (SSD) device is partitioned, and the backed-up metadata information is copied to the DB partition of the new SSD device.

5. A cache disk replacement device, characterized in that, Applications in distributed object storage systems include: The information storage module is used to save metadata information in the original cache disk DB partition when the wear of the original solid-state drive device is detected to reach a preset threshold. The target disk creation module is used to replace the new solid-state drive (SSD) device and create a target cache disk using the original main storage device and metadata information from the original SSD. The cache disk replacement module is used to start the target cache disk, reconstruct the dirty data of the original cache disk and the new data generated by the disk replacement operation, and complete the cache disk replacement. The cache disk replacement device further includes: The data deletion unit is used to delete cached data recorded in the cache partition from the metadata information based on the received deletion parameters; The cache disk replacement device further includes: A cache disk construction unit is used to construct a cache disk based on the Cache partition, DB partition, and main storage device. The cache disk replacement module includes: The data reconstruction unit is used to reconstruct new cache data in the cache partition of the new cache disk based on the dirty data in the cache disk under normal conditions and the new data modified by the business increment generated by the disk swapping operation; the dirty data is data that has not been flushed to the main storage device.

6. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the cache disk replacement method as described in any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that, Used to store computer programs; wherein, when the computer programs are executed by a processor, they implement the steps of the cache disk replacement method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Request response method, device, equipment and computer readable storage medium

    CN111026331A