Cache data synchronization method and apparatus, electronic device, and storage medium
Patent Information
- Application Number
- CN202310905171.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-21
- Publication Date
- 2026-10-16
- Estimated Expiration
- 2043-07-21
AI Technical Summary
[0006]本申请实施例提供一种缓存数据同步方法、装置、电子设备及存储介质,以解决相关技术中故障控制器回切时会中断IO导致业务受到影响,或者分批下刷方式依赖下层的磁盘必须是在线的,否则就无法完成镜像对的重组,在极端情况下可能会影响四控的可靠性的问题
[0057] In this embodiment, write cache data is split into several cache region objects according to set rules. Upon receiving a failover event from the fault controller, the mirror priority of the cache region object is determined based on the IO frequency of the corresponding cache region. Synchronization is then performed on the cache region object based on this mirror priority. This embodiment effectively selects the cache region with the greatest impact on host IO for priority synchronization by splitting write cache data into several cache region objects according to set rules and synchronizing them according to the mirror priority determined by IO frequency. This reduces the potential for data accumulation that could lead to excessively long response times from the storage system to the host, effectively improving the reliability of the storage system while ensuring its stability. This ensures that the storage system can provide stable service to customers under various fault scenarios.
Smart Images

Figure CN116954504B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of multi-controller storage technology, and in particular to a cache data synchronization method, apparatus, electronic device and storage medium. Background Technology
[0002] To improve the overall performance and availability of storage systems, many storage systems support two or even four controllers. By adding additional controllers, the overall performance and availability of the storage system can be improved.
[0003] To maximize the performance of a four-controller storage system, improve the utilization of memory and computing resources, and balance the availability of the storage system, many storage systems use a cached circular mirroring approach in four-controller storage systems. That is, data with controller 0 as the master controller is backed up to controller 1, data with controller 1 as the master controller is backed up to controller 2, and so on.
[0004] The above four-control implementation scheme will perform backup node reorganization when a system failure occurs, such as when a node goes down (a node drop event). When the downed node recovers, team recovery will be performed.
[0005] For controller rollback scenarios, the current most common implementation is to first pause I / O, then flush the write cache on a single controller, synchronize the root area after flushing is complete, and finally team up with the recovered controller. This controller rollback approach can guarantee data consistency and security, but it interrupts I / O during a rollback, affecting business operations. Another optimized approach is to flush in batches, affecting only the I / O currently being flushed, blocking I / O destined for that part. The drawback of this approach is that the underlying disks must be online; otherwise, the mirror pair cannot be reassembled. In extreme cases, this may affect the reliability of the four controllers. For example, if one node goes offline and reassembly cannot be completed, and another node goes offline, even if the disks come back online, services will still be unavailable. Summary of the Invention
[0006] This application provides a cache data synchronization method, apparatus, electronic device, and storage medium to solve the problems in related technologies where faulty controllers interrupt IO during failover, causing business disruptions, or where batch flushing methods rely on the underlying disks being online, otherwise the reassembly of mirror pairs cannot be completed, which may affect the reliability of the four controllers in extreme cases.
[0007] To solve the above-mentioned technical problems, the embodiments of this application are implemented as follows:
[0008] In a first aspect, embodiments of this application provide a cache data synchronization method, the method comprising:
[0009] According to the set rules, the write cache data is split into several cache region objects;
[0010] Upon receiving a fault controller switchback event, the mirror priority of the cache region object is determined based on the IO frequency of the cache region corresponding to the cache region object.
[0011] Based on the image priority, a synchronization operation is performed on the cache region object.
[0012] Optionally, the step of splitting the write cache data into several cache region objects according to the set rules includes:
[0013] According to the rule of minimum splitting granularity, the write cache data is split to obtain several cache region objects.
[0014] Optionally, determining the mirror priority of the cache region object based on the I / O frequency of the cache region corresponding to the cache region object includes:
[0015] Get the I / O frequency of the cache region corresponding to the cache region object within a preset time period from the current time;
[0016] Based on the I / O frequency, set the mirror priority of the cache region object;
[0017] The frequency of I / O is directly proportional to the priority of the image.
[0018] Optionally, after determining the mirror priority of the cache region object based on the I / O frequency of the cache region corresponding to the cache region object, the method further includes:
[0019] The cache region objects are stored sequentially in the cache region synchronization list according to the image priority from high to low.
[0020] Optionally, performing a synchronization operation on the cache region object based on the mirror priority includes:
[0021] Synchronization operations are performed on the cache area objects sequentially according to the front-to-back order of the cache area synchronization linked list;
[0022] Perform a synchronization operation on the root region corresponding to the cache region object.
[0023] Optionally, performing a synchronization operation on the cache region object based on the mirror priority includes:
[0024] During the synchronization of the cache region object, the target cache region where IO events occur is obtained;
[0025] The target cache region object corresponding to the target cache region is placed at the head of the cache region synchronization list, and a synchronization operation is performed on the target cache region object.
[0026] Optionally, after performing the synchronization operation on the target cache region object, the method further includes:
[0027] After synchronizing the root area corresponding to the target cache area object, the IO event is processed.
[0028] Optionally, after performing a synchronization operation on the cache region object based on the mirror priority, the method further includes:
[0029] Determine whether all cache areas have completed the three-replica synchronization operation;
[0030] In response to the completion of the three-replica synchronization operation in all cache areas, the mirror pair reassembly operation process is initiated.
[0031] Secondly, embodiments of this application provide a cached data synchronization device, the device comprising:
[0032] The cache region object retrieval module is used to split write cache data into several cache region objects according to the set rules;
[0033] The mirror priority determination module is used to determine the mirror priority of the cache region object based on the IO frequency of the cache region corresponding to the cache region object when a fault controller switchback event is received.
[0034] The synchronization operation execution module is used to perform synchronization operations on the cache region object based on the image priority.
[0035] Optionally, the cache region object acquisition module includes:
[0036] The cache region object acquisition unit is used to split the write cache data according to the rule of minimum split granularity to obtain several cache region objects.
[0037] Optionally, the image priority determination module includes:
[0038] The IO frequency acquisition unit is used to acquire the IO frequency of the cache region corresponding to the cache region object within a preset time period from the current time.
[0039] The mirror priority setting unit is used to set the mirror priority of the cache area object according to the IO frequency;
[0040] The frequency of I / O is directly proportional to the priority of the image.
[0041] Optionally, the device further includes:
[0042] The cache region object storage module is used to store the cache region objects sequentially in the cache region synchronization list according to the image priority from high to low.
[0043] Optionally, the synchronization operation execution module includes:
[0044] The object synchronization execution unit is used to perform synchronization operations on the cache area objects sequentially according to the front-to-back order of the cache area synchronization linked list;
[0045] The root region synchronization execution unit is used to perform synchronization operations on the root region corresponding to the cache region object.
[0046] Optionally, the synchronization operation execution module includes:
[0047] The target cache region acquisition unit is used to acquire the target cache region where IO events exist during the synchronization of the cache region object.
[0048] The synchronization operation execution unit is used to place the target cache region object corresponding to the target cache region at the head position of the cache region synchronization list and perform a synchronization operation on the target cache region object.
[0049] Optionally, the device further includes:
[0050] The IO event handling module is used to process the IO event after the synchronization of the root area corresponding to the target cache area object is completed.
[0051] Optionally, the device further includes:
[0052] The synchronization operation determination module is used to determine whether all cache areas have completed the three-replica synchronization operation;
[0053] The automatic reorganization module is used to initiate the mirror pair reorganization process in response to the completion of the three-replica synchronization operation in all cache areas.
[0054] Thirdly, embodiments of this application provide an electronic device, including:
[0055] A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the cache data synchronization method described in any of the preceding claims.
[0056] Fourthly, embodiments of this application provide a readable storage medium that, when the instructions in the storage medium are executed by the processor of an electronic device, enables the electronic device to perform the cache data synchronization method described in any of the preceding claims.
[0057] In this embodiment, write cache data is split into several cache region objects according to set rules. Upon receiving a failover event from the fault controller, the mirror priority of the cache region object is determined based on the IO frequency of the corresponding cache region. Synchronization is then performed on the cache region object based on this mirror priority. This embodiment effectively selects the cache region with the greatest impact on host IO for priority synchronization by splitting write cache data into several cache region objects according to set rules and synchronizing them according to the mirror priority determined by IO frequency. This reduces the potential for data accumulation that could lead to excessively long response times from the storage system to the host, effectively improving the reliability of the storage system while ensuring its stability. This ensures that the storage system can provide stable service to customers under various fault scenarios.
[0058] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, specific embodiments of this application are given below. Attached Figure Description
[0059] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments of this application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0060] Figure 1 A flowchart illustrating the steps of a cache data synchronization method provided in this application embodiment;
[0061] Figure 2 A flowchart illustrating the steps of a method for obtaining a cache region object provided in this application embodiment;
[0062] Figure 3 A flowchart illustrating the steps of a method for setting mirror priority according to an embodiment of this application;
[0063] Figure 4 A flowchart illustrating the steps of a cache region object storage method provided in this application embodiment;
[0064] Figure 5A flowchart illustrating the steps of a synchronous operation execution method provided in this application embodiment;
[0065] Figure 6 A flowchart illustrating the steps of another synchronous operation execution method provided in this application embodiment;
[0066] Figure 7 A flowchart illustrating the steps of an IO event handling method provided in this application embodiment;
[0067] Figure 8 A flowchart illustrating the steps of a mirror pair reassembly process initiation method provided in this application embodiment;
[0068] Figure 9 This is a schematic diagram of the structure of a cache data synchronization device provided in an embodiment of this application;
[0069] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0070] 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 this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0071] In existing technologies, I / O is interrupted during controller switchback, affecting business operations. Other optimization solutions involve batch flushing, where only the I / O currently being flushed is affected, blocking I / O destined for that part. The drawback of this solution is that it relies on the underlying disk being online; otherwise, the mirror pair cannot be reassembled. In extreme cases, this may affect the reliability of the four controllers. For example, if one node fails and the disk goes offline, reassembly cannot be completed. If another node fails, even if the disk comes back online, services cannot be provided.
[0072] To address the aforementioned issues, the inventive approach of this application is as follows: by splitting write cache data into several cache region objects according to set rules, and synchronizing them according to the mirror priority determined by IO frequency, the cache region that has the greatest impact on host IO can be effectively selected for priority synchronization, thereby reducing the potential data accumulation that could lead to excessively long response times from the storage system to the host.
[0073] Next, the technical solutions of the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0074] Reference Figure 1The flowchart illustrates the steps of a cache data synchronization method provided in an embodiment of this application, as follows: Figure 1 As shown, the cache data synchronization method may include steps 101, 102 and 103.
[0075] Step 101: According to the set rules, split the write cache data into several cache area objects.
[0076] The embodiments of this application can be applied to scenarios where, after a node failure is recovered during a four-controller storage process, the cache area that has the greatest impact on host I / O is selected for priority synchronization during system fault rollback.
[0077] The rules can be pre-defined rules with the smallest granularity of splitting. Understandably, the corresponding data splitting rules should also be different for different types of write cache data.
[0078] In practical implementation, when a controller failure occurs, the write cache data can be split into several cache region objects according to the set rules. In this example, since the write cache data is already at the smallest granularity, there is no need to split it; the write cache data can be directly used as the cache region object. Of course, the write cache data can be split into a larger number of cache region objects, such as 10, 8, etc. Specifically, the number of cache region objects obtained from splitting the write cache data can be determined according to the actual situation, and this embodiment does not impose any restrictions on this.
[0079] The specific splitting process can be combined with... Figure 2 The following is a detailed description.
[0080] Reference Figure 2 The diagram illustrates a flowchart of a method for obtaining a cache region object according to an embodiment of this application. Figure 2 As shown, the method for obtaining the cache region object may include: step 201.
[0081] Step 201: According to the rule of minimum splitting granularity, the write cache data is split to obtain several cache area objects.
[0082] In this embodiment, the write cache data can be split according to the rule of minimum splitting granularity to obtain several cache area objects.
[0083] In practical applications, the prerequisites for implementing a four-controller cache with three replicas in a storage system can be: splitting write cache data packets according to certain rules (granularity); allocating memory resources when data is written to the write cache; and releasing the corresponding memory resources when the data is flushed down (perfected persistence). That is, when the memory corresponding to the write cache area is empty, it can be understood that there is no corresponding cached data in memory, and all of it has been written to the disk.
[0084] In a normal four-controller setup, every two controllers cache the data belonging to their respective domains. When host data is written, it is first written to the master node of the domain, then mirrored to the backup. Only then will the write request receive a successful response from the host. This two-backup approach ensures the security of the cached data.
[0085] Understandably, the rules for the minimum splitting granularity are different for different data. The rules for the minimum splitting granularity define the finest granularity at which each write cache data can be split. In specific implementations, the rules for the minimum splitting granularity of different types of write cache data can be different. The rules for the minimum splitting granularity can be determined according to the actual situation, and this embodiment does not impose any restrictions on this.
[0086] This application embodiment splits the write cache data according to the rule of the smallest split granularity, which can ensure that the split granularity of the write cache data is fine enough, so that the impact on host IO is small enough and there will be no IO interruption.
[0087] After splitting the write cache data into several cache region objects according to the set rules, step 102 is executed.
[0088] Step 102: Upon receiving a fault controller switchback event, determine the mirror priority of the cache region object based on the IO frequency of the cache region corresponding to the cache region object.
[0089] In this embodiment, I / O (Input / Output) is divided into two parts: I / O devices and I / O interfaces. On POSIX-compliant systems, such as Linux, I / O operations can take many forms, such as DIO (Direct I / O), AIO (Asynchronous I / O), and Memory-Mapped I / O. Different I / O methods have different implementations and performance characteristics, and different I / O methods can be selected according to different applications.
[0090] After splitting write cache data into several cache region objects according to the set rules, the mirror priority of the cache region object can be determined based on the IO frequency of the cache region corresponding to the cache region object when a fault controller switchback event is received.
[0091] In practical implementation, upon receiving a fault controller switchback event, the cache region object can be assigned a corresponding mirror priority based on the descending order of its I / O frequency. This implementation process can be combined with... Figure 3 The following is a detailed description.
[0092] Reference Figure 3 The diagram illustrates a flowchart of a method for setting mirror priority according to an embodiment of this application. Figure 3 As shown, the image priority setting method may include steps 301 and 302.
[0093] Step 301: Obtain the IO frequency of the cache region corresponding to the cache region object within a preset time period from the current time.
[0094] In this embodiment, the preset duration can be a pre-set duration for calculating the I / O frequency of the cache region. In this example, the preset duration can be 10 days, one month, etc. Specifically, the specific value of the preset duration can be determined according to business needs, and this embodiment does not impose any restrictions on it.
[0095] In practical implementation, the I / O frequency of the cache region corresponding to the cache region object within a preset time period can be obtained. Specifically, the I / O frequency of each cache region within a unit of time period can be calculated. For example, if the preset time period is 10 days, the number of all I / O events in the cache region within 10 days can be obtained on a daily basis, i.e., the total number of I / O events. Then, the I / O frequency of the cache region = total number of I / O events / 10, etc.
[0096] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0097] After obtaining the IO frequency of the cache region corresponding to the cache region object within a preset time period from the current time, step 302 is executed.
[0098] Step 302: Set the mirror priority of the cache region object according to the IO frequency.
[0099] After obtaining the I / O frequency of the cache region corresponding to the cache region object within a preset time period from the current time, the mirror priority of the cache region object can be set according to the I / O frequency. In this example, the I / O frequency and mirror priority are directly proportional; that is, the higher the I / O frequency of the cache region corresponding to the cache region object, the higher the mirror priority of the cache region object, and vice versa. For example, the cache region objects include: object 1, object 2, and object 3, and the cache regions corresponding to these three cache region objects are region 1, region 2, and region 3, respectively. The calculated I / O frequency of region 1 is frequency 1, the I / O frequency of region 2 is frequency 2, and the I / O frequency of region 3 is frequency 3, and frequency 1 < frequency 3 < frequency 2. Therefore, the mirror priority of object 1 is the lowest, and the mirror priority of object 2 is the highest, that is, the mirror priority of object 1 < the mirror priority of object 3 < the mirror priority of object 2, and so on.
[0100] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0101] This application embodiment adjusts the image priority based on the frequency of IO to prioritize the synchronization of memory regions with higher IO frequency, thereby minimizing the impact on host IO.
[0102] In this embodiment, a cache region synchronization list can be pre-created, in which cache region objects can be stored according to mirror priority. The storage procedure for cache region objects can be combined with... Figure 4 The following is a detailed description.
[0103] Reference Figure 4 The diagram illustrates a flowchart of a cache area object storage method provided in an embodiment of this application. Figure 4 As shown, the cache area object storage method may include: step 401.
[0104] Step 401: Store the cache region objects in the cache region synchronization list in descending order of mirror priority.
[0105] In this embodiment, after determining the mirror priority of a cache region object based on the I / O frequency of the cache region corresponding to that object, the cache region objects can be stored sequentially in the cache region synchronization list in descending order of mirror priority. That is, the cache region object with the highest mirror priority is located at the head of the cache region synchronization list, while the cache region object with the lowest mirror priority is located at the tail of the list. The storage method of cache region objects in the linked list can be as shown in Table 1 below:
[0106] Table 1 Cache Area Synchronization Linked List
[0107] Object 1 Mirror priority 1 Object 2 Mirror priority 2 Object 3 Mirror priority 3
[0108] As shown in Table 1 above, the mirror priorities corresponding to object 1, object 2 and object 3 are respectively: mirror priority 1, mirror priority 2 and mirror priority 3, and mirror priority 1 > mirror priority 2 > mirror priority 3, etc.
[0109] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0110] After determining the image priority of the cache region object based on the IO frequency of the cache region corresponding to the cache region object, step 103 is executed.
[0111] Step 103: Perform a synchronization operation on the cache region object based on the image priority.
[0112] After determining the mirror priority of a cache region object based on the I / O frequency of the corresponding cache region, synchronization operations can be performed on the cache region objects based on the mirror priority. Specifically, synchronization operations can be performed on the cache region objects sequentially in descending order of mirror priority. For example, if the cache region objects include: object 1, object 2, object 3, object 4, and object 5, and these five cache region objects are arranged in descending order of mirror priority as: object 2, object 3, object 4, object 1, and object 5, then when performing synchronization operations on these cache region objects, synchronization can be performed first on object 2. After object 2 is synchronized, synchronization can be performed on object 3, then on object 4, then on object 1, and finally on object 5. Once all five cache region objects are synchronized, the synchronization of the cache region objects is complete.
[0113] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0114] This application embodiment splits write cache data into several cache region objects according to set rules and synchronizes them according to the mirror priority determined by IO frequency. This effectively filters out the cache regions that have the greatest impact on host IO for priority synchronization, reducing the potential for data accumulation that could lead to excessive latency in the storage system's response to the host. While ensuring the stability of the storage system, this effectively improves its reliability, guaranteeing stable service to customers under various failure scenarios. Furthermore, when a controller failure occurs and a failback occurs, the cache is disassembled, packaged, and mirrored to the other end at a certain granularity. If the granularity of the cache mirroring process is sufficiently fine, the impact on host IO will be minimal, and there will be no IO interruption.
[0115] In practical implementation, when performing synchronization operations on cache region objects, they can be retrieved and synchronized according to their order in the cache region synchronization linked list. This implementation process can be combined with... Figure 5 The following is a detailed description.
[0116] Reference Figure 5 The diagram illustrates a flowchart of the steps of a synchronous operation execution method provided in an embodiment of this application. Figure 5 As shown, the synchronous operation execution method may include steps 501 and 502.
[0117] Step 501: Perform synchronization operations on the cache area objects sequentially according to the order of the cache area synchronization list from front to back.
[0118] In this embodiment, after storing the cache region objects in the cache region synchronization list, synchronization operations can be performed on the cache region objects sequentially according to the order of the cache region synchronization list from front to back. For example, if the cache region objects in the cache region synchronization list are in the following order from front to back: object a, object b, object c, object d, then when performing synchronization operations on the cache region objects, the synchronization operation can be performed on object a first. After object a is synchronized, the synchronization operation is performed on object b. After object b is synchronized, the synchronization operation is performed on object c. After object c is synchronized, the synchronization operation is performed on object d, and so on, until all cache region objects in the cache region synchronization list are synchronized.
[0119] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0120] After performing synchronization operations on the cache area objects in the order of the cache area synchronization list from front to back, proceed to step 502.
[0121] Step 502: Perform a synchronization operation on the root region corresponding to the cache region object.
[0122] After performing synchronization operations on the cache region objects sequentially according to the cache region synchronization list from front to back, the synchronization operation can then be performed on the root region corresponding to each cache region object. Understandably, each cache region object has its corresponding root region. During the synchronization process, the cache region object itself is synchronized first, followed by its corresponding root region. This process continues until all cache region objects have been synchronized. For example, if the cache region objects are: object 1, object 2, object 3, object 4, and object 5, and their corresponding root regions are: root1, root2, root3, root4, and root5 respectively, then the synchronization operation can begin with object 1. After object 1 is synchronized, the synchronization operation can proceed to root1. After root1 is synchronized, the synchronization operation can continue with object 2. After object 2 is synchronized, the synchronization operation can proceed to root2. After root2 is synchronized, synchronization can be performed on object 3. After object 3 is synchronized, synchronization can be performed on root3. After root3 is synchronized, synchronization can be performed on object 4. After object 4 is synchronized, synchronization can be performed on root4. After root4 is synchronized, synchronization can be performed on object 5. After object 5 is synchronized, synchronization can be performed on root5, and so on, until root5 is synchronized.
[0123] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0124] Once the corresponding cache area is synchronized, the corresponding root area will continue to be synchronized. During this period, the host I / O of the corresponding cache area is suspended. Once the image is completed, it will trigger the next step of processing.
[0125] This application embodiment performs synchronization operations on cache area objects sequentially according to the cache area synchronization linked list from front to back. This can achieve priority synchronization of the cache area that has the greatest impact on host I / O, reducing the possibility of data accumulation that could lead to excessively long response times from the storage system to the host.
[0126] In the specific implementation, when performing cache three-copy mirror synchronization, there is a cache area synchronization linked list used to control the order of cache mirror synchronization. The corresponding cache area object can be added to the list to be synchronized. Empty cache areas will be placed at the head of the list, because these only need to synchronize the root area. Once prepared, they are ready to be synchronized.
[0127] In this embodiment, during the synchronization operation on the cache region object, if an I / O insertion occurs in a cache region, the corresponding cache region can be removed from the list to be synchronized and moved two positions to the head of the list. This implementation process can be combined with... Figure 6 The following is a detailed description.
[0128] Reference Figure 6 The diagram illustrates a flowchart of another synchronous operation execution method provided in an embodiment of this application. Figure 6 As shown, the synchronous operation execution method may include steps 601 and 602.
[0129] Step 601: During the synchronization of the cache area object, obtain the target cache area where IO events exist.
[0130] In this embodiment, during the synchronization of cache region objects, target cache regions where IO events occur can be obtained. For example, the cache regions corresponding to the cache region objects include: cache region 1, cache region 2, cache region 3, ..., cache region 10. During the synchronization of cache region objects, if IO insertions are detected in cache region 3, cache region 5, and cache region 6, then cache region 3, cache region 5, and cache region 6 can be regarded as target cache regions, etc.
[0131] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0132] After obtaining the target cache region with IO events during the synchronization of the cache region object, step 602 is executed.
[0133] Step 602: Place the target cache region object corresponding to the target cache region at the head position of the cache region synchronization list, and perform a synchronization operation on the target cache region object.
[0134] After identifying the target cache region with an I / O event during the synchronization of cache region objects, the target cache region object can be placed at the head of the cache region synchronization list, and synchronization operations can be performed on the target cache region object. For example, the cache region objects include: object 1, object 2, object 3, object 4, and object 5. Object 1 corresponds to cache region 1, object 2 to cache region 2, object 3 to cache region 3, object 4 to cache region 4, and object 5 to cache region 5. The objects 1, 2, 3, 4, and 5 are ordered from front to back in the cache region synchronization list as: object 1, object 2, object 3, object 4, and object 5. After synchronizing object 1, if I / O insertions are detected in cache regions 4 and 5, the order of the cache region objects in the cache region synchronization list can be adjusted. The adjusted cache region synchronization list, from front to back, is: object 4, object 5, object 2, object 3 (at this point, object 1 has been processed), and so on.
[0135] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0136] This embodiment of the application, during the synchronization operation of cache area objects, if there is an IO insertion in a cache area, can remove the corresponding cache area from the synchronization list and move it two positions to the head of the list. This ensures that requests with host IO backlog can receive faster responses, increases synchronization priority, and reduces host response latency. The introduction of this four-controller fault fallback handling implementation method can effectively reduce the impact of controller fallback on host IO while ensuring the stability of the entire storage system, avoiding host IO interruptions and improving the overall reliability of the storage system.
[0137] After synchronizing the root region corresponding to the target cache region object, the corresponding IO events can be processed. This implementation process can be combined with... Figure 7 The following is a detailed description.
[0138] Reference Figure 7 The diagram illustrates a flowchart of the steps of an IO event handling method provided in an embodiment of this application. Figure 7 As shown, the IO event handling method may include: step 701.
[0139] Step 701: After synchronizing the root area corresponding to the target cache area object, process the IO event.
[0140] In this embodiment, after performing a synchronization operation on the target cache region object, a synchronization operation is then performed on the root region corresponding to the target cache region object.
[0141] After synchronizing the root region corresponding to the target cache region object, I / O events inserted into the target cache region can be processed. That is, during the synchronization of the target cache region object and its corresponding root region, I / O events inserted into the target cache region are first suspended, waiting for the synchronization operation of the target cache region object and its corresponding root region. Only after the synchronization of the target cache region object and its corresponding root region is complete are the suspended I / O events processed. For example, the target cache region objects include: object 1, object 2, and object 3, and the root regions corresponding to object 1, object 2, and object 3 are root1, root2, and root3, respectively. In specific execution, synchronization can be performed on object 1 first. After object 1 is synchronized, synchronization can be performed on root1. After root1 is synchronized, I / O events inserted into the target cache region corresponding to object 1 can be processed. After the I / O events inserted into the target buffer area corresponding to object 1 have been processed, synchronization operations can be performed on object 2. After object 2 is synchronized, synchronization operations can be performed on root2. After root2 is synchronized, I / O events inserted into the target buffer area corresponding to object 2 can be processed. After the I / O events inserted into the target buffer area corresponding to object 2 have been processed, synchronization operations can be performed on object 3. After object 3 is synchronized, synchronization operations can be performed on root3. After root3 is synchronized, I / O events inserted into the target buffer area corresponding to object 3 can be processed, and so on.
[0142] It is understood that the above examples are merely examples listed to better understand the technical solutions of the embodiments of this application, and are not intended to be the only limitation on the embodiments.
[0143] In the actual implementation, during the synchronization of each cache area, other areas are not affected and can perform IO processing normally on the original grouped controller.
[0144] Once each cache region is synchronized, new I / O will no longer be processed on the original two controllers; instead, each I / O should be processed on the three controllers that have completed three replicas.
[0145] In this embodiment, after synchronization is completed in all cache regions, the mirror pair reassembly process can be initiated. This implementation process can be combined with... Figure 8 The following is a detailed description.
[0146] Reference Figure 8The diagram illustrates a flowchart of the steps involved in initiating a mirror pair recombination operation according to an embodiment of this application. Figure 8 As shown, the mirror image reassembly process initiation method may include steps 801 and 802.
[0147] Step 801: Determine whether all cache areas have completed the three-replica synchronization operation.
[0148] In this embodiment, it can be determined whether all cache regions have completed the three-replica synchronization operation. In a specific implementation, a monitoring thread can be pre-set. After the synchronization operation for each cache region is completed, the monitoring thread is called to determine whether the three-replica synchronization operation has been completed for all cache regions.
[0149] Under normal four-controller configuration, each pair of controllers caches data belonging to its domain. When host data is written, it is first written to the master node of the domain, then mirrored to the backup. Only then will the write request receive a successful response from the host, ensuring the security of cached data through two backups. When a controller failover event occurs—that is, when the failed controller comes back online and rejoins the cluster to take over the business—the controller failover process is triggered, thus achieving synchronization of four controllers and three replicas.
[0150] In practical applications, other methods can also be used to monitor whether all cache areas have completed the three-replica synchronization operation, such as monitoring software, etc. Specifically, the method for monitoring whether all cache areas have completed the three-replica synchronization operation can be determined according to business needs, and this embodiment does not impose any restrictions on it.
[0151] After confirming that all cache areas have completed the three-replica synchronization operation, proceed to step 802.
[0152] Step 802: In response to the completion of the three-replica synchronization operation in all cache areas, initiate the mirror pair reassembly operation process.
[0153] If it is determined that there are cache regions where the three-replica synchronization operation has not yet been completed, then the synchronization operation is performed on the cache regions where the three-replica synchronization operation has not yet been completed.
[0154] If it is confirmed that all cache regions have completed the three-replica synchronization operation, then the mirror pair reassembly operation process can be initiated in response to the completion of the three-replica synchronization operation in all cache regions.
[0155] This application's embodiments can perform cache synchronization without blocking host I / O, greatly reducing the impact on the host and providing rapid responses to host read and write requests. Simple cache synchronization skips the disk flushing step, effectively reducing the impact of fault recovery on other modules, such as RAID offline issues. Furthermore, the cache synchronization priority algorithm proposed in this solution can effectively select the cache areas with the greatest impact on host I / O for priority synchronization, reducing the potential for data accumulation that could lead to excessive latency in the storage system's response to the host. Simultaneously, by performing priority-based write cache split synchronization, the impact of fault recovery on I / O processing is reduced, improving the availability of the storage system. The cache packet split synchronization method reduces the scope of I / O that might be blocked during cache synchronization, minimizing the impact on I / O; priority-based write cache data synchronization reduces the amount of cache data synchronized; and creating a three-controller replica after synchronization is complete, and a two-controller replica before synchronization is complete, ensures the security of the storage system data.
[0156] The cache data synchronization method provided in this application splits write cache data into several cache region objects according to set rules. Upon receiving a fault controller switchback event, it determines the mirror priority of the cache region objects based on the IO frequency of the corresponding cache region, and performs synchronization operations on the cache region objects based on the mirror priority. This application embodiment, by splitting write cache data into several cache region objects according to set rules and synchronizing according to the mirror priority determined by IO frequency, can effectively filter out the cache regions with the greatest impact on host IO for priority synchronization. This reduces the potential for data accumulation that could lead to excessively long response times from the storage system to the host, effectively improving the reliability of the storage system while ensuring its stability, and ensuring that the storage system can provide stable service to customers under various fault scenarios.
[0157] Reference Figure 9 The diagram illustrates the structure of a cached data synchronization device provided in an embodiment of this application. Figure 9 As shown, the cached data synchronization device 900 may include the following modules:
[0158] The cache region object acquisition module 910 is used to split write cache data into several cache region objects according to the set rules;
[0159] The mirror priority determination module 920 is used to determine the mirror priority of the cache region object based on the IO frequency of the cache region corresponding to the cache region object when a fault controller switchback event is received.
[0160] The synchronization operation execution module 930 is used to perform synchronization operations on the cache region object based on the image priority.
[0161] Optionally, the cache region object acquisition module 910 includes:
[0162] The cache region object acquisition unit is used to split the write cache data according to the rule of minimum split granularity to obtain several cache region objects.
[0163] Optionally, the mirror priority determination module 920 includes:
[0164] The IO frequency acquisition unit is used to acquire the IO frequency of the cache region corresponding to the cache region object within a preset time period from the current time.
[0165] The mirror priority setting unit is used to set the mirror priority of the cache area object according to the IO frequency;
[0166] The frequency of I / O is directly proportional to the priority of the image.
[0167] Optionally, the device further includes:
[0168] The cache region object storage module is used to store the cache region objects sequentially in the cache region synchronization list according to the image priority from high to low.
[0169] Optionally, the synchronization operation execution module 930 includes:
[0170] The object synchronization execution unit is used to perform synchronization operations on the cache area objects sequentially according to the front-to-back order of the cache area synchronization linked list;
[0171] The root region synchronization execution unit is used to perform synchronization operations on the root region corresponding to the cache region object.
[0172] Optionally, the synchronization operation execution module 930 includes:
[0173] The target cache region acquisition unit is used to acquire the target cache region where IO events exist during the synchronization of the cache region object.
[0174] The synchronization operation execution unit is used to place the target cache region object corresponding to the target cache region at the head position of the cache region synchronization list and perform a synchronization operation on the target cache region object.
[0175] Optionally, the device further includes:
[0176] The IO event handling module is used to process the IO event after the synchronization of the root area corresponding to the target cache area object is completed.
[0177] Optionally, the device further includes:
[0178] The synchronization operation determination module is used to determine whether all cache areas have completed the three-replica synchronization operation;
[0179] The automatic reorganization module is used to initiate the mirror pair reorganization process in response to the completion of the three-replica synchronization operation in all cache areas.
[0180] The cache data synchronization device provided in this application splits write cache data into several cache region objects according to set rules. Upon receiving a fault controller switchback event, it determines the mirror priority of the cache region objects based on the IO frequency of the corresponding cache region, and performs synchronization operations on the cache region objects based on the mirror priority. This application embodiment, by splitting write cache data into several cache region objects according to set rules and synchronizing them according to the mirror priority determined by IO frequency, can effectively filter out the cache regions with the greatest impact on host IO for priority synchronization. This reduces the potential for data accumulation that could lead to excessively long response times from the storage system to the host, effectively improving the reliability of the storage system while ensuring its stability, and ensuring that the storage system can provide stable service to customers under various fault scenarios.
[0181] Additionally, this application also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the above-described cache data synchronization method.
[0182] Figure 10 A schematic diagram of the structure of an electronic device 1000 according to an embodiment of the present invention is shown. Figure 10 As shown, the electronic device 1000 includes a central processing unit (CPU) 1001, which can perform various appropriate actions and processes according to computer program instructions stored in read-only memory (ROM) 1002 or loaded from storage unit 1008 into random access memory (RAM) 1003. The RAM 1003 may also store various programs and data required for the operation of the electronic device 1000. The CPU 1001, ROM 1002, and RAM 1003 are interconnected via bus 1004. An input / output (I / O) interface 1005 is also connected to bus 1004.
[0183] Multiple components in electronic device 1000 are connected to I / O interface 1005, including: input unit 1006, such as keyboard, mouse, microphone, etc.; output unit 1007, such as various types of monitors, speakers, etc.; storage unit 1008, such as disk, optical disk, etc.; and communication unit 1009, such as network card, modem, wireless transceiver, etc. Communication unit 1009 allows electronic device 1000 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0184] The various processes and handling described above can be executed by processing unit 1001. For example, the methods of any of the above embodiments can be implemented as computer software programs tangibly contained in a computer-readable medium, such as storage unit 1008. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 1000 via ROM 1002 and / or communication unit 1009. When the computer program is loaded into RAM 1003 and executed by CPU 1001, one or more actions of the methods described above can be performed.
[0185] This application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the various processes of the above-described cache data synchronization method embodiments and achieves the same technical effect. To avoid repetition, it will not be described again here. The computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0186] It should be noted that, in this document, 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. Unless otherwise specified, 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 that element.
[0187] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0188] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0189] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. 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 use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0190] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0191] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0192] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0193] In addition, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0194] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0195] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for synchronizing cached data, characterized in that, The method includes: According to the set rules, the write cache data is split into several cache region objects; Upon receiving a fault controller switchback event, the mirror priority of the cache region object is determined based on the IO frequency of the cache region corresponding to the cache region object. The cache region objects are stored sequentially in the cache region synchronization list according to the image priority from high to low. Based on the image priority, a synchronization operation is performed on the cache region object, including: during the synchronization of the cache region object, obtaining the target cache region where an IO event exists; adjusting the target cache region object corresponding to the target cache region to the head position of the cache region synchronization list, and performing a synchronization operation on the target cache region object.
2. The method according to claim 1, characterized in that, The process of splitting write cache data into several cache region objects according to the set rules includes: According to the rule of minimum splitting granularity, the write cache data is split to obtain several cache region objects.
3. The method according to claim 1, characterized in that, The step of determining the image priority of the cache region object based on the I / O frequency of the cache region corresponding to the cache region object includes: Get the I / O frequency of the cache region corresponding to the cache region object within a preset time period from the current time; Based on the I / O frequency, set the mirror priority of the cache region object; The frequency of I / O is directly proportional to the priority of the image.
4. The method according to claim 1, characterized in that, The step of performing a synchronization operation on the cache region object based on the image priority further includes: Synchronization operations are performed on the cache area objects sequentially according to the front-to-back order of the cache area synchronization linked list; Perform a synchronization operation on the root region corresponding to the cache region object.
5. The method according to claim 1, characterized in that, After performing the synchronization operation on the target cache region object, the method further includes: After synchronizing the root area corresponding to the target cache area object, the IO event is processed.
6. The method according to claim 1, characterized in that, After performing a synchronization operation on the cache region object based on the mirror priority, the method further includes: Determine whether all cache areas have completed the three-replica synchronization operation; In response to the completion of the three-replica synchronization operation in all cache areas, the mirror pair reassembly operation process is initiated.
7. A cached data synchronization device, characterized in that, The device includes: The cache region object retrieval module is used to split write cache data into several cache region objects according to the set rules; The mirror priority determination module is used to determine the mirror priority of the cache region object based on the IO frequency of the cache region corresponding to the cache region object when a fault controller switchback event is received. The cache region object storage module is used to store the cache region objects in the cache region synchronization linked list in descending order of the image priority. A synchronization operation execution module is used to perform synchronization operations on the cache region object based on the image priority; The synchronization operation execution module includes: a target cache region acquisition unit, used to acquire a target cache region with IO events during the synchronization of the cache region object; and a synchronization operation execution unit, used to adjust the target cache region object corresponding to the target cache region to the head position of the cache region synchronization linked list, and perform a synchronization operation on the target cache region object.
8. The apparatus according to claim 7, characterized in that, The cache region object acquisition module includes: The cache region object acquisition unit is used to split the write cache data according to the rule of minimum split granularity to obtain several cache region objects.
9. The apparatus according to claim 7, characterized in that, The image priority determination module includes: The IO frequency acquisition unit is used to acquire the IO frequency of the cache region corresponding to the cache region object within a preset time period from the current time. The mirror priority setting unit is used to set the mirror priority of the cache area object according to the IO frequency; The frequency of I / O is directly proportional to the priority of the image.
10. The apparatus according to claim 7, characterized in that, The synchronization operation execution module includes: The object synchronization execution unit is used to perform synchronization operations on the cache area objects sequentially according to the front-to-back order of the cache area synchronization linked list; The root region synchronization execution unit is used to perform synchronization operations on the root region corresponding to the cache region object.
11. The apparatus according to claim 7, characterized in that, The device further includes: The IO event handling module is used to process the IO events after the synchronization of the root area corresponding to the target cache area object is completed.
12. The apparatus according to claim 7, characterized in that, The device further includes: The synchronization operation determination module is used to determine whether all cache areas have completed the three-replica synchronization operation; The automatic reorganization module is used to initiate the mirror pair reorganization process in response to the completion of the three-replica synchronization operation in all cache areas.
13. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the cache data synchronization method as described in any one of claims 1 to 6.
14. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the electronic device, the electronic device is able to perform the cache data synchronization method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Cache management method and storage device
CN115129230A
Controller back-switching control method, controller back-switching control device, controller back-switching equipment, storage system and storage medium
CN116450415A