Movatterモバイル変換


[0]ホーム

URL:


CN106528338B - A remote data replication method, storage device and storage system - Google Patents

A remote data replication method, storage device and storage system
Download PDF

Info

Publication number
CN106528338B
CN106528338BCN201610971200.0ACN201610971200ACN106528338BCN 106528338 BCN106528338 BCN 106528338BCN 201610971200 ACN201610971200 ACN 201610971200ACN 106528338 BCN106528338 BCN 106528338B
Authority
CN
China
Prior art keywords
controller
data
file
replication
replication task
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610971200.0A
Other languages
Chinese (zh)
Other versions
CN106528338A (en
Inventor
孔晓龙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co LtdfiledCriticalHuawei Technologies Co Ltd
Priority to CN201610971200.0ApriorityCriticalpatent/CN106528338B/en
Priority to CN202010780943.6Aprioritypatent/CN112068992B/en
Publication of CN106528338ApublicationCriticalpatent/CN106528338A/en
Priority to PCT/CN2017/081341prioritypatent/WO2018076633A1/en
Application grantedgrantedCritical
Publication of CN106528338BpublicationCriticalpatent/CN106528338B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

Translated fromChinese

一种远程数据复制方法、存储设备及存储系统。其中,第一控制器检测本地是否有复制任务;当所述第一控制器中没有复制任务时,所述第一控制器向所述第二控制器发送请求消息。所述请求消息用于向所述第二控制器申请复制任务,所述第二控制器至少包括两个复制任务。所述第二控制器根据所述请求消息,读取第一个复制任务对应的数据并发送给所述第一控制器。所述第一控制器接收所述第一个复制任务对应的数据,将所述第一个复制任务对应的数据发送给所述灾备阵列,所述第二控制器将第二个复制任务对应的数据发送给所述灾备阵列。从而达到了多控系统中并行复制数据的目的。

Figure 201610971200

A remote data replication method, storage device, and storage system. A first controller detects whether there is a replication task locally; when there is no replication task in the first controller, the first controller sends a request message to the second controller. The request message is used to apply for a replication task from the second controller, and the second controller includes at least two replication tasks. Based on the request message, the second controller reads the data corresponding to the first replication task and sends it to the first controller. The first controller receives the data corresponding to the first replication task and sends the data corresponding to the first replication task to the disaster recovery array, and the second controller sends the data corresponding to the second replication task to the disaster recovery array. This achieves the purpose of parallel data replication in a multi-controller system.

Figure 201610971200

Description

Translated fromChinese
一种远程数据复制方法、存储设备及存储系统A remote data replication method, storage device and storage system

技术领域technical field

本发明实施例涉及存储技术领域,特别是一种远程数据复制方法、存储设备及存储系统。The embodiments of the present invention relate to the technical field of storage, and in particular, to a remote data replication method, a storage device, and a storage system.

背景技术Background technique

数据容灾,又称为远程数据复制技术,是指建立一个异地的数据系统,该系统是本地数据的一个可用复制。在本地数据及整个应用系统出现灾难时,系统至少在异地保存有一份可用的关键业务的数据。Data disaster recovery, also known as remote data replication technology, refers to the establishment of a remote data system, which is an available copy of local data. In the event of a disaster in the local data and the entire application system, the system at least saves an available key business data in a different place.

典型的数据容灾系统包括生产中心和灾备中心。在生产中心,部署有主机、存储阵列,用于正常的业务运行;在灾备中心,部署有主机、存储阵列,用于在生产中心发生灾难后,接管其业务。在海量存储系统中,生产中心的存储阵列和灾备中心的存储阵列通常都是包含多个控制器的存储阵列。不同的控制器可以分别对同一个文件进行写入和修改,为了保证复制到灾备中心的文件和生产中心的文件保持一致,各个控制器对该文件进行的写入操作需要串行复制到灾备中心,影响了复制效率。A typical data disaster recovery system includes a production center and a disaster recovery center. In the production center, hosts and storage arrays are deployed for normal business operation; in the disaster recovery center, hosts and storage arrays are deployed to take over its business after a disaster occurs in the production center. In a mass storage system, the storage array of the production center and the storage array of the disaster recovery center are usually storage arrays containing multiple controllers. Different controllers can write and modify the same file respectively. In order to ensure that the files copied to the disaster recovery center are consistent with those of the production center, the write operations performed by each controller on the file need to be serially copied to the disaster recovery center. The backup center affects the replication efficiency.

发明内容SUMMARY OF THE INVENTION

本实施例提供了一种远程数据复制方法和存储系统,能够在多控系统中并发地执行复制任务。This embodiment provides a remote data replication method and storage system, which can execute replication tasks concurrently in a multi-controller system.

第一方面,提供了一种远程数据复制方法。所述方法应用于存储系统中,所述存储系统包括生产阵列和灾备阵列,所述生产阵列至少包括第一控制器和第二控制器。第一控制器检测本地是否有复制任务,当没有复制任务时,向第二控制器发送请求消息。所述请求消息用于向所述第二控制器申请复制任务,第二控制器至少包括两个复制任务。第二控制器根据所述请求消息,读取第一个复制任务对应的数据并发送给所述第一控制器。第一控制器接收所述第一个复制任务对应的数据,将所述第一个复制任务对应的数据发送给灾备阵列,第二控制器也将第二个复制任务对应的数据发送给所述灾备阵列。In a first aspect, a remote data replication method is provided. The method is applied to a storage system, the storage system includes a production array and a disaster recovery array, and the production array at least includes a first controller and a second controller. The first controller detects whether there is a replication task locally, and when there is no replication task, sends a request message to the second controller. The request message is used to apply for a replication task to the second controller, and the second controller includes at least two replication tasks. According to the request message, the second controller reads the data corresponding to the first replication task and sends the data to the first controller. The first controller receives the data corresponding to the first replication task, sends the data corresponding to the first replication task to the disaster recovery array, and the second controller also sends the data corresponding to the second replication task to the Describe the disaster recovery array.

在本实施例中,第一控制器没有复制任务,处于空闲状态,而第二控制器至少包括两个复制任务,处于繁忙状态。因此,第一控制器可以向第二控制器发送请求消息,以申请复制任务。第二控制器根据所述请求消息,将自己的至少两个两个复制任务分配一个给第一控制器,从而第一控制器和第二控制器可以各自执行一个复制任务,达到了并行处理了的目的,提高了复制效率。In this embodiment, the first controller has no replication tasks and is in an idle state, while the second controller includes at least two replication tasks and is in a busy state. Therefore, the first controller can send a request message to the second controller to apply for the replication task. According to the request message, the second controller assigns one of its at least two replication tasks to the first controller, so that the first controller and the second controller can each execute one replication task, achieving parallel processing. for the purpose of improving the replication efficiency.

在第一方面的第一种实施方式中,所述第二控制器维护有复制队列,所述复制队列包括所述至少两个复制任务。因此,第二控制器具体是从所述复制队列中获取第一个复制任务,并将第一个复制任务对应的数据发送给第一控制器。另外,第二控制器也是从所述复制队列中获取第二复制任务,将所述第二复制任务对应的数据发送给所述灾备阵列。In a first implementation manner of the first aspect, the second controller maintains a replication queue, and the replication queue includes the at least two replication tasks. Therefore, the second controller specifically acquires the first replication task from the replication queue, and sends the data corresponding to the first replication task to the first controller. In addition, the second controller also obtains the second replication task from the replication queue, and sends the data corresponding to the second replication task to the disaster recovery array.

结合第一方面,以及第一方面的第一种实施方式,在第二种实施方式中,第一个复制任务和所述第二个复制任务是针对同一个文件的复制任务。由此实现了同一个文件的并行复制。With reference to the first aspect and the first implementation manner of the first aspect, in a second implementation manner, the first copying task and the second copying task are copying tasks for the same file. This enables parallel replication of the same file.

结合第一方面的第二种实施方式,在第三种实施方式中,所述文件具有唯一的文件名,所述第一个复制任务对应的数据包括所述文件名,所述文件的初始数据,以及所述初始数据的写入时间,所述第二个复制任务对应的数据包括所述文件名,所述文件的修改数据,以及所述修改数据的写入时间,所述修改数据的写入时间晚于所述初始数据的写入时间。With reference to the second implementation manner of the first aspect, in the third implementation manner, the file has a unique file name, the data corresponding to the first copy task includes the file name, the initial data of the file , and the writing time of the initial data, the data corresponding to the second copy task includes the file name, the modified data of the file, and the writing time of the modified data, the write of the modified data The entry time is later than the writing time of the initial data.

结合第一方面的第三种实施方式,在第四种实施方式中,所述灾备阵列接收所述第一个复制任务对应的数据,创建所述文件的备份文件,将所述初始数据写入所述备份文件,所述备份文件的文件名与所述文件的文件名相同。在所述接收所述第一个复制任务对应的数据之后,所述灾备阵列接收所述第二个复制任务对应的数据。所述灾备阵列确定所述第二个复制任务对应的文件名与所述备份文件的文件名相同时,判断所述修改数据的写入时间是否晚于所述初始数据的写入时间。当所述灾备阵列确定所述修改数据的写入时间晚于所述初始数据的写入时间时,将所述修改数据写入所述备份文件中。在这种实施方式中,如果灾备阵列先接收初始数据,再接收修改数据,可以将修改数据写入备份文件中。即使修改数据会覆盖初始数据,也不会造成灾备阵列和生产阵列的数据不一致。With reference to the third implementation manner of the first aspect, in the fourth implementation manner, the disaster recovery array receives the data corresponding to the first replication task, creates a backup file of the file, and writes the initial data into the backup file, and the file name of the backup file is the same as the file name of the file. After receiving the data corresponding to the first replication task, the disaster recovery array receives the data corresponding to the second replication task. When determining that the file name corresponding to the second copy task is the same as the file name of the backup file, the disaster recovery array determines whether the writing time of the modified data is later than the writing time of the initial data. When the disaster recovery array determines that the writing time of the modified data is later than the writing time of the initial data, the modified data is written into the backup file. In this embodiment, if the disaster recovery array receives the initial data first, and then receives the modified data, the modified data can be written into the backup file. Even if the modified data will overwrite the initial data, it will not cause data inconsistency between the disaster recovery array and the production array.

结合第一方面的第三种实施方式,在第五种实施方式中,所述灾备阵列接收所述第二个复制任务对应的数据,创建所述文件的备份文件,将所述修改数据写入所述备份文件,所述备份文件的文件名与所述文件的文件名相同。在所述接收所述第二个复制任务对应的数据之后,所述灾备阵列接收所述第一个复制任务对应的数据。所述灾备阵列确定所述第一个复制任务对应的文件名与所述备份文件的文件名相同时,判断所述初始数据的写入时间是否晚于所述修改数据的写入时间。当所述灾备阵列确定所述初始数据的写入时间早于所述修改数据的写入时间时,不执行将所述初始数据写入所述备份文件中的操作。在这种实施方式中,如果灾备阵列先接收修改数据,再接收初始数据,则不执行将初始数据写入备份文件的操作,以防止灾备阵列和生产阵列的数据不一致。With reference to the third implementation manner of the first aspect, in the fifth implementation manner, the disaster recovery array receives data corresponding to the second replication task, creates a backup file of the file, and writes the modified data to into the backup file, and the file name of the backup file is the same as the file name of the file. After receiving the data corresponding to the second replication task, the disaster recovery array receives the data corresponding to the first replication task. The disaster recovery array determines whether the writing time of the initial data is later than the writing time of the modified data when it is determined that the file name corresponding to the first copy task is the same as the file name of the backup file. When the disaster recovery array determines that the writing time of the initial data is earlier than the writing time of the modified data, the operation of writing the initial data into the backup file is not performed. In this embodiment, if the disaster recovery array first receives the modified data and then receives the initial data, the operation of writing the initial data to the backup file is not performed to prevent data inconsistency between the disaster recovery array and the production array.

本发明第二方面提供了一种存储设备,以执行第一方面提供的方法。A second aspect of the present invention provides a storage device to perform the method provided in the first aspect.

本发明第三方面提供了一种存储设备,以执行第一方面提供的方法。A third aspect of the present invention provides a storage device to perform the method provided in the first aspect.

附图说明Description of drawings

为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍。In order to illustrate the technical solutions of the embodiments of the present invention more clearly, the accompanying drawings required in the embodiments will be briefly introduced below.

图1是本发明实施例提供的系统架构示意图;1 is a schematic diagram of a system architecture provided by an embodiment of the present invention;

图2是本发明实施例提供的控制器的结构图;2 is a structural diagram of a controller provided by an embodiment of the present invention;

图3是本发明实施例提供的远程数据复制方法的流程示意图。FIG. 3 is a schematic flowchart of a remote data replication method provided by an embodiment of the present invention.

具体实施方式Detailed ways

本实施例提供了一种远程数据复制方法、存储设备和存储系统,能够在多控系统中并发地执行复制任务。This embodiment provides a remote data replication method, storage device, and storage system, which can concurrently execute replication tasks in a multi-controller system.

图1为本发明实施例提供的远程数据复制方法的系统架构示意图,如图1所示,生产中心包括生产主机、连接设备和生产阵列20;灾备中心的系统架构与生产中心类似,包括灾备主机、连接设备和灾备阵列30。在本发明实施例中,灾备中心可以不止一个。其中,生产中心与灾备中心可以通过IP(Internet Protocol)或者FC(Fiber Chanel)或者其他协议进行数据传输。FIG. 1 is a schematic diagram of a system architecture of a remote data replication method provided by an embodiment of the present invention. As shown in FIG. 1, a production center includes a production host, a connection device, and aproduction array 20; the system architecture of the disaster recovery center is similar to that of the production center, including the Backup hosts, connected devices, anddisaster recovery arrays 30. In this embodiment of the present invention, there may be more than one disaster recovery center. Among them, the production center and the disaster recovery center can transmit data through IP (Internet Protocol) or FC (Fiber Chanel) or other protocols.

生产主机和灾备主机均可以是任何计算设备,如服务器、台式计算机等等。在主机内部,安装有操作系统以及其他应用程序。Both the production host and the disaster recovery host can be any computing devices, such as servers, desktop computers, and so on. Inside the host, an operating system and other applications are installed.

连接设备可以是存储设备和主机之间的任何接口,如光纤交换机,或者其他当前技术已知有的交换机。The connecting device can be any interface between the storage device and the host, such as a fiber optic switch, or other switches known in the art.

生产阵列20和灾备阵列30均可以是存储设备,如独立硬盘冗余阵列(RedundantArrays of Inexpensive Disks,RAID)、硬盘簇(Just a Bunch Of Disks,JBOD)、直接存取存储器(Direct Access Storage Device,DASD)的一个或多个互连的硬盘驱动器,诸如磁带库、一个或多个存储单元的磁带存储设备。Both theproduction array 20 and thedisaster recovery array 30 may be storage devices, such as redundant arrays of independent hard disks (Redundant Arrays of Inexpensive Disks, RAID), hard disk clusters (Just a Bunch Of Disks, JBOD), direct access storage devices (Direct Access Storage Device) , DASD) of one or more interconnected hard drives, such as tape libraries, tape storage devices of one or more storage units.

本实施例中的生产阵列20和灾备阵列30均是具有文件系统的存储设备,也就是说,存储介质中保存的数据是以文件为单位进行管理和访问的。文件系统是一种存储和组织数据的方法,它使得对数据的访问和查找变得容易,文件系统使用文件和树形目录的抽象逻辑概念代替了硬盘等物理设备使用的数据块的概念。生产阵列20在使用文件系统来保存数据后,用户不必关心数据实际保存在硬盘的地址为多少的数据块上,只需要记住这个文件的所属目录和文件名。同样的,在写入新数据之前,用户不必关心硬盘上的那个块地址没有被使用,硬盘上的存储空间管理(分配和释放)功能由文件系统自动完成,用户只需要记住数据被写入到了哪个文件中。Both theproduction array 20 and thedisaster recovery array 30 in this embodiment are storage devices with file systems, that is, the data stored in the storage medium is managed and accessed in units of files. A file system is a method of storing and organizing data that makes it easy to access and find data. File systems use the abstract logical concept of files and tree directories instead of the concept of data blocks used by physical devices such as hard disks. After theproduction array 20 uses the file system to save data, the user does not need to care about the data blocks at which the data is actually saved on the hard disk, and only needs to remember the directory and file name of the file. Similarly, before writing new data, the user does not need to care that the block address on the hard disk is not used, the storage space management (allocation and release) function on the hard disk is automatically completed by the file system, and the user only needs to remember that the data is written to which file.

生产阵列20和灾备阵列30的硬件结构是相同的。图2是本发明实施例生产阵列20的结构示意图,图3是本发明实施例灾备阵列30的结构示意图。The hardware structures of theproduction array 20 and thedisaster recovery array 30 are the same. FIG. 2 is a schematic structural diagram of aproduction array 20 according to an embodiment of the present invention, and FIG. 3 is a schematic structural diagram of adisaster recovery array 30 according to an embodiment of the present invention.

如图2所示,生产阵列20至少包括控制器21、控制器22和若干个硬盘31。控制器21可以包括任何计算设备,如服务器、台式计算机等等。在控制器内部,安装有文件系统以及其他应用程序。控制器21用于执行和文件相关的各种操作,例如创建文件、创建目录、读文件操作、写文件操作、发送数据复制请求等等。控制器22和控制器21的结构类似,功能相同。生产阵列20包含的若干个硬盘31用于提供存储空间保存文件。需要说明的是,控制器21和控制器22仅是本发明实施例的示例,在本发明实施例中还可以包含其他控制器,本实施例并没有对控制器的数量进行限定。As shown in FIG. 2 , theproduction array 20 includes at least acontroller 21 , a controller 22 and several hard disks 31 .Controller 21 may include any computing device, such as a server, desktop computer, and the like. Inside the controller, the file system and other applications are installed. Thecontroller 21 is used to perform various operations related to files, such as creating a file, creating a directory, reading a file, writing a file, sending a data copy request, and so on. The structure of the controller 22 and thecontroller 21 are similar, and the functions are the same. Several hard disks 31 included in theproduction array 20 are used to provide storage space for storing files. It should be noted that thecontroller 21 and the controller 22 are only examples of the embodiments of the present invention, and other controllers may also be included in the embodiments of the present invention, and the number of controllers is not limited in this embodiment.

控制器21主要包括处理器(processor)118、缓存(cache)120、存储器(memory)122、通信总线(简称总线)126以及通信接口(Communication Interface)128。处理器118、缓存120、存储器122以及通信接口128通过通信总线126完成相互间的通信。Thecontroller 21 mainly includes a processor (processor) 118 , a cache (cache) 120 , a memory (memory) 122 , a communication bus (bus for short) 126 and a communication interface (Communication Interface) 128 . The processor 118 , the cache 120 , the memory 122 and the communication interface 128 communicate with each other through the communication bus 126 .

通信接口128,用于与生产主机、灾备阵列以及硬盘31通信。另外,通信接口128还用于与控制器22通信。The communication interface 128 is used to communicate with the production host, the disaster recovery array and the hard disk 31 . Additionally, the communication interface 128 is also used to communicate with the controller 22 .

存储器122,用于存放程序124,存储器122可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个硬盘存储器。可以理解的是,存储器122可以为随机存储器(Random-Access Memory,RAM)、磁碟、硬盘、光盘、固态硬盘(SolidState Disk,SSD)或者非易失性存储器等各种可以存储程序代码的非短暂性的(non-transitory)机器可读介质。The memory 122 is used to store the program 124. The memory 122 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one hard disk memory. It can be understood that the memory 122 can be a random-access memory (Random-Access Memory, RAM), a magnetic disk, a hard disk, an optical disk, a solid state disk (Solid State Disk, SSD) or a non-volatile memory and other non-volatile memory devices that can store program codes. Transient (non-transitory) machine-readable medium.

程序124可以包括程序代码,所述程序代码包括上面描述的文件系统以及其他程序代码。Program 124 may include program code, including the file system described above, as well as other program code.

缓存120(Cache)用于缓存从生产主机接收的数据或从硬盘中读取的数据。缓存120可以是RAM、ROM、闪存(Flash memory)或固态硬盘(Solid State Disk,SSD)等各种可以存储数据的非短暂性的(non-transitory)机器可读介质,在此不做限定。The cache 120 (Cache) is used to cache the data received from the production host or the data read from the hard disk. The cache 120 may be various non-transitory (non-transitory) machine-readable media capable of storing data, such as RAM, ROM, flash memory (Flash memory) or solid state disk (Solid State Disk, SSD), which is not limited herein.

另外,存储器122和缓存120可以合设或者分开设置,本发明实施例对此不做限定。In addition, the memory 122 and the cache 120 may be set together or separately, which is not limited in this embodiment of the present invention.

处理器118可能是一个中央处理器CPU,或者是特定集成电路ASIC(ApplicationSpecific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 118 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.

灾备阵列30的结构和生产阵列20相同,其作用是当生产阵列20发生故障时,可以接替生产阵列20继续处理业务。The structure of thedisaster recovery array 30 is the same as that of theproduction array 20, and its function is to take over theproduction array 20 to continue processing services when theproduction array 20 fails.

下面结合图1和图2,描述本发明实施例一种远程数据复制方法。该方法应用在图1所示的异步远程复制的场景中,由生产阵列20和灾备阵列30执行。如图3所述,所述方法可以包括以下步骤:The following describes a remote data replication method according to an embodiment of the present invention with reference to FIG. 1 and FIG. 2 . This method is applied in the asynchronous remote replication scenario shown in FIG. 1 , and is executed by theproduction array 20 and thedisaster recovery array 30 . As shown in Figure 3, the method may include the following steps:

步骤1:第一控制器21检测本地是否有复制任务。Step 1: Thefirst controller 21 detects whether there is a copy task locally.

复制任务是指将数据从生产阵列20复制到灾备阵列30的任务。示例性的,第一控制器的缓存中保存有一个复制队列,所述复制队列中可以包括多个复制任务,每个复制任务可以用文件名、文件数据的写入时间等信息来描述。第一控制器可以通过检查所述复制队列所包含的信息来确定当前是否具有复制任务。另外,队列只是本发明实施例的一个示例,本实施例还可以采用其他数据结构,例如堆、栈等,来保存复制任务。The replication task refers to the task of replicating data from theproduction array 20 to thedisaster recovery array 30 . Exemplarily, a copy queue is stored in the cache of the first controller, and the copy queue may include multiple copy tasks, and each copy task may be described by information such as file name and file data writing time. The first controller may determine whether there is currently a replication task by checking the information contained in the replication queue. In addition, the queue is only an example of the embodiment of the present invention, and other data structures, such as heap, stack, etc., may also be used in this embodiment to store the copy task.

步骤2:当第一控制器21没有复制任务时,向第二控制器22发送请求消息。Step 2: When thefirst controller 21 has no replication task, send a request message to the second controller 22.

所述请求消息用于向第二控制器22申请复制任务。可以理解的是,生产阵列20中可能包含其他控制器,某些控制器处于空闲状态(没有复制任务),而某些控制器可能处于繁忙状态(包括多个待处理的复制任务),那么处于空闲状态的控制器可以向处于繁忙状态的控制器申请复制任务。为了方便描述,本实施例以第二控制器22为处于繁忙状态的控制器为例,所述第二控制器22至少包括两个复制任务。The request message is used to apply to the second controller 22 for a replication task. It will be appreciated that theproduction array 20 may contain other controllers, some of which may be idle (no replication tasks) and some may be busy (including multiple pending replication tasks), then A controller in an idle state can apply for replication tasks to a controller in a busy state. For convenience of description, in this embodiment, the second controller 22 is taken as an example in a busy state, and the second controller 22 includes at least two replication tasks.

在实际应用中,第一控制器21可以分别向生产阵列20中的每个控制器发送查询消息,以获取每个控制器待处理的复制任务。再从中选择出一个处于繁忙状态的控制器,向其发送请求消息。或者,在生产阵列20中确定一个控制器,用于采集各个控制器待处理的复制任务的数量,并通知第一控制器21当前处于繁忙状态的控制器。In practical applications, thefirst controller 21 may send a query message to each controller in theproduction array 20 to acquire the replication tasks to be processed by each controller. Then select a controller in a busy state and send a request message to it. Alternatively, one controller is determined in theproduction array 20 to collect the number of replication tasks to be processed by each controller, and notify thefirst controller 21 of the controller that is currently in a busy state.

步骤3:第二控制器22根据所述请求消息,分配一个或多个复制任务给第一控制器21。Step 3: The second controller 22 allocates one or more replication tasks to thefirst controller 21 according to the request message.

与第一控制器21类似,第二控制器的缓存中也保存有一个复制队列,所述复制队列中可以包括多个复制任务。第二控制器可以将其中的一个或多个复制任务分配给第一控制器21,以保证各个控制器之间的任务均衡。具体的,第二控制器22可以根据先进先出的原则,将最早进入所述队列的一个或多个复制任务分配给第一控制器21。所谓分配复制任务给第一控制器21,具体可以是将所述复制任务对应的数据发送给第一控制器21。所述复制任务对应的数据包括待复制给灾备阵列30的数据,本发明实施例将待复制给灾备阵列30的数据称为文件数据,也就是文件对应的数据块。由于所述复制任务可以用文件名来描述,因此通过所述文件名以及相应的元数据可以获取文件数据,并发送给第一控制器21。另外,除了所述文件数据之外,所述复制任务对应的数据还包括所述文件数据所属的文件的文件名以及所述文件数据的写入时间。所述文件数据的写入时间是指所述文件数据写入所述生产阵列的时间,它可能是一个具体的时间点,也可能是用于表示一段时间范围的时间区间,还有可能是表示所述文件的版本信息的版本号。本实施例并不对所述写入时间的含义和形式进行任何限定,只要能够通过各个写入时间的对比得出文件数据写入所述生产阵列的先后顺序即可。Similar to thefirst controller 21, the cache of the second controller also stores a replication queue, and the replication queue may include multiple replication tasks. The second controller may assign one or more of the replication tasks to thefirst controller 21 to ensure task balance among the controllers. Specifically, the second controller 22 may allocate one or more replication tasks that enter the queue earliest to thefirst controller 21 according to the principle of first-in, first-out. The so-called allocating the replication task to thefirst controller 21 may specifically be sending the data corresponding to the replication task to thefirst controller 21 . The data corresponding to the replication task includes data to be replicated to thedisaster recovery array 30 . In this embodiment of the present invention, the data to be replicated to thedisaster recovery array 30 is referred to as file data, that is, a data block corresponding to the file. Since the copying task can be described by a file name, file data can be acquired through the file name and corresponding metadata, and sent to thefirst controller 21 . In addition, in addition to the file data, the data corresponding to the copy task further includes the file name of the file to which the file data belongs and the writing time of the file data. The writing time of the file data refers to the time when the file data is written into the production array. It may be a specific time point, or a time interval used to indicate a range of time, or it may be a The version number of the file's version information. This embodiment does not impose any limitation on the meaning and form of the writing time, as long as the order in which the file data is written into the production array can be obtained by comparing the writing times.

一个队列里面的多个复制任务,可能是针对同一个文件的复制任务(这些复制任务的文件名相同),也可能是针对不同文件的复制任务。以针对同一个文件的多个复制任务为例,所述多个复制任务对应针对所述文件的多次写入操作。本发明实施例可以利用一个序列号来记录对文件的多次写入操作。例如,当一个文件刚被创建时,也就是执行第一次写入操作时,其序列号为1;当所述文件被修改,也就是执行第二次写入操作时,其序列号为2。所谓执行针对一个文件的多个复制任务也就是将所述文件对应的多次写入操作同步至灾备阵列。因此,每次复制任务可以对应一个唯一的序列号。Multiple copy tasks in a queue may be copy tasks for the same file (the file names of these copy tasks are the same), or may be copy tasks for different files. Taking multiple copy tasks for the same file as an example, the multiple copy tasks correspond to multiple write operations for the file. In this embodiment of the present invention, a serial number can be used to record multiple write operations to a file. For example, when a file is just created, that is, when the first write operation is performed, its sequence number is 1; when the file is modified, that is, when the second write operation is performed, its sequence number is 2 . The so-called execution of multiple replication tasks for a file is to synchronize multiple write operations corresponding to the file to the disaster recovery array. Therefore, each replication task can correspond to a unique sequence number.

为了方便描述,本实施例将第二控制器22分配给第一控制器21的复制任务称为第一复制任务,将第二控制器22分配给第一控制器21的复制任务之外,队列中剩余的复制任务称为第二复制任务。例如,第一个复制任务以及第二个复制任务可分别包括如下信息:For the convenience of description, in this embodiment, the replication task assigned by the second controller 22 to thefirst controller 21 is referred to as the first replication task, and in addition to the replication task assigned by the second controller 22 to thefirst controller 21, the queue The remaining replication task in is called the second replication task. For example, the first replication task and the second replication task can each include the following information:

文件名file name序列号serial number文件数据的写入时间File data write time0X1000X1000010012016.1.12016.1.10X1000X1000020022016.1.22016.1.2

如上表所示,第一个复制任务对应的数据属于文件名为0X100的文件名,所述数据的写入时间是2016.1.1,所述第一个复制任务的序列号是001;第二个复制任务对应的数据属于文件名为0X100的文件名,所述数据的写入时间是2016.1.2,所述第二个复制任务的序列号是002。As shown in the above table, the data corresponding to the first copy task belongs to the file name of 0X100, the writing time of the data is 2016.1.1, and the serial number of the first copy task is 001; The data corresponding to the copy task belongs to the file name of 0X100, the writing time of the data is 2016.1.2, and the sequence number of the second copy task is 002.

步骤4:第一控制器21接收第一个复制任务对应的数据,并且将所述数据发送给灾备阵列30。Step 4: Thefirst controller 21 receives the data corresponding to the first replication task, and sends the data to thedisaster recovery array 30 .

具体的,第二控制器22可以根据文件名以及对应的元数据,获取文件数据,将所述文件数据、文件名、序列号以及所述文件数据的写入时间发送给第一控制器21。由第一控制器21执行所述复制任务,也就是说将所述文件数据、文件名、序列号以及所述文件数据的写入时间发送给灾备阵列30。Specifically, the second controller 22 may acquire file data according to the file name and corresponding metadata, and send the file data, file name, serial number, and writing time of the file data to thefirst controller 21 . Thefirst controller 21 executes the replication task, that is, the file data, the file name, the serial number, and the writing time of the file data are sent to thedisaster recovery array 30 .

步骤5:第二控制器22将第二个复制任务对应的数据发送给灾备阵列30。Step 5: The second controller 22 sends the data corresponding to the second replication task to thedisaster recovery array 30 .

具体的,第二控制器22根据所述第二个复制任务记录的文件名以及对应的元数据获取文件数据,并且将所述文件数据、文件名以及所述文件数据的写入时间发送给灾备阵列30。Specifically, the second controller 22 obtains the file data according to the file name recorded by the second copy task and the corresponding metadata, and sends the file data, the file name and the writing time of the file data to thedisaster Array 30 is prepared.

通过图3所示的实施方式,处于空闲状态的控制器可以向处于繁忙状态的控制器申请复制任务,处于繁忙状态的控制器将自己的复制任务分配一部分给处于空闲状态的控制器,由此,各个控制器可以并行地处理复制任务,提高了复制效率。Through the implementation shown in FIG. 3 , the controller in the idle state can apply for a replication task to the controller in the busy state, and the controller in the busy state allocates a part of its replication task to the controller in the idle state, thereby , each controller can process replication tasks in parallel, which improves the replication efficiency.

下面介绍当各个控制器并行处理复制任务时,如何保证灾备阵列的文件与生产阵列的文件的一致性。The following describes how to ensure the consistency of the files of the disaster recovery array and the files of the production array when each controller processes the replication tasks in parallel.

由图3所示,第一控制器21执行第一个复制任务,将第一个复制任务对应的文件数据复制给了灾备阵列30;第二控制器22执行第二个复制任务,将第二个复制任务对应的文件数据复制给了灾备阵列30。为了方便描述,将第一个复制任务对应的文件数据简称为数据A,将第二个复制任务对应的文件数据简称为数据B。虽然第一控制器21和第二控制器22是并行地执行这两个复制任务,然而灾备阵列30往往并不是同时接收数据A和数据B的时间的。As shown in FIG. 3, thefirst controller 21 executes the first copy task, and copies the file data corresponding to the first copy task to thedisaster recovery array 30; the second controller 22 executes the second copy task, The file data corresponding to the two copy tasks is copied to thedisaster recovery array 30 . For convenience of description, the file data corresponding to the first copy task is abbreviated as data A, and the file data corresponding to the second copy task is abbreviated as data B. Although thefirst controller 21 and the second controller 22 execute the two replication tasks in parallel, thedisaster recovery array 30 often does not receive data A and data B at the same time.

情况1:灾备阵列30先接收数据A,再接收数据B。Case 1: Thedisaster recovery array 30 receives data A first, and then receives data B.

灾备阵列30在接收数据A时,还会一并接收并保存数据A所属的文件的文件名,第一复制任务的序列号以及数据A的写入时间。灾备阵列可以遍历本地的文件的文件名,确定数据A不属于本地的任何一个文件。从而,创建一个新文件,所述新文件是数据A在生产阵列所属的文件的备份文件。所述备份文件的文件名可以与源文件(数据A在生产阵列所属的文件)一致。随后,灾备阵列30将数据A写入所述备份数据,并记录数据A的写入时间,所述写入时间与生产阵列20发送的数据A的写入时间相同。When thedisaster recovery array 30 receives the data A, it also receives and saves the file name of the file to which the data A belongs, the serial number of the first replication task, and the writing time of the data A. The disaster recovery array can traverse the file names of local files to determine that data A does not belong to any local file. Thus, a new file is created that is a backup file of the file to which data A belongs in the production array. The file name of the backup file may be consistent with the source file (the file to which data A belongs in the production array). Subsequently, thedisaster recovery array 30 writes the data A into the backup data, and records the writing time of the data A, which is the same as the writing time of the data A sent by theproduction array 20 .

在灾备阵列30接收数据A之后,接收数据B。由于数据B所属的文件的文件名和上述备份文件的文件名相同,灾备阵列30不需再创建新的文件。接下来,灾备阵列30记录数据B对应的写入时间,所述写入时间与生产阵列20发送的数据B的写入时间相同。灾备阵列30比较数据B的写入时间和数据A的写入时间,确定数据B的写入时间晚于数据A的写入时间,因此数据A是所述备份文件的初始数据,而数据B是所述备份文件的修改数据。修改数据可以覆盖初始数据,灾备阵列执行将数据B写入所述备份文件的操作。After thedisaster recovery array 30 receives data A, data B is received. Since the file name of the file to which data B belongs is the same as the file name of the above-mentioned backup file, thedisaster recovery array 30 does not need to create a new file. Next, thedisaster recovery array 30 records the writing time corresponding to the data B, and the writing time is the same as the writing time of the data B sent by theproduction array 20 . Thedisaster recovery array 30 compares the writing time of data B with the writing time of data A, and determines that the writing time of data B is later than the writing time of data A. Therefore, data A is the initial data of the backup file, and data B is the initial data of the backup file. is the modified data of the backup file. The modified data can overwrite the initial data, and the disaster recovery array executes the operation of writing data B into the backup file.

情况2:灾备阵列30先接收数据B,再接收数据A。Case 2: Thedisaster recovery array 30 receives data B first, and then receives data A.

灾备阵列30在接收数据B时,遍历本地的文件的文件名,确定数据B不属于本地的任何一个文件。从而,创建一个新文件,所述新文件是数据B在生产阵列所属的文件的备份文件。所述备份文件的文件名可以与源文件(数据B在生产阵列所属的文件)一致。随后,灾备阵列30将数据B写入所述备份数据,并记录数据B的写入时间,所述写入时间与生产阵列20发送的数据B的写入时间相同。When receiving the data B, thedisaster recovery array 30 traverses the file names of the local files to determine that the data B does not belong to any local file. Thus, a new file is created, which is a backup file of the file to which data B belongs in the production array. The file name of the backup file may be consistent with the source file (the file to which data B belongs in the production array). Subsequently, thedisaster recovery array 30 writes the data B into the backup data, and records the writing time of the data B, which is the same as the writing time of the data B sent by theproduction array 20 .

在灾备阵列30接收数据B之后,接收数据A。由于数据A所属的文件的文件名和上述备份文件的文件名相同,灾备阵列30不需再创建新的文件。接下来,灾备阵列30记录数据A对应的写入时间,所述写入时间与生产阵列20发送的数据A的写入时间相同。灾备阵列30比较数据B的写入时间和数据A的写入时间,确定数据A的写入时间早于数据B的写入时间,因此数据A是所述备份文件的初始数据,而数据B是所述备份文件的修改数据。初始数据不可以覆盖修改数据,灾备阵列不执行将数据A写入所述备份文件的操作。After thedisaster recovery array 30 receives data B, data A is received. Since the file name of the file to which data A belongs is the same as the file name of the above-mentioned backup file, thedisaster recovery array 30 does not need to create a new file. Next, thedisaster recovery array 30 records the writing time corresponding to the data A, and the writing time is the same as the writing time of the data A sent by theproduction array 20 . Thedisaster recovery array 30 compares the writing time of data B with the writing time of data A, and determines that the writing time of data A is earlier than the writing time of data B. Therefore, data A is the initial data of the backup file, while data B is the initial data of the backup file. is the modified data of the backup file. The original data cannot overwrite the modified data, and the disaster recovery array does not perform the operation of writing the data A into the backup file.

由此,灾备阵列30在接收针对同一个文件的多个数据时,可以根据各个数据的写入时间判断是否执行对备份文件的写入操作,其原则是,只能用写入时间较晚的数据覆盖写入时间较早的数据,由此保证了文件的一致性。Therefore, when thedisaster recovery array 30 receives multiple data for the same file, it can determine whether to perform the writing operation to the backup file according to the writing time of each data. The principle is that only the writing time is later. The new data overwrites the data with the earlier write time, thus ensuring the consistency of the file.

另外,当生产阵列20中的文件被删除时,为了保持一致,灾备阵列30中的备份文件也需要被删除。具体的,生产阵列20可以向灾备阵列发送删除文件的指令,所述指令包括所述文件的文件名,以及最新的序列号(最后一次写入操作对应的序列号)。灾备阵列30接收所述删除文件的指令之后,根据所述文件名查找到相应的备份文件,判断所述备份文件的最新的序列号是否与生产阵列20发送的序列号相同。若相同,则灾备阵列30执行删除所述备份文件的操作;否则,不执行删除所述备份文件的操作。In addition, when the files in theproduction array 20 are deleted, in order to maintain consistency, the backup files in thedisaster recovery array 30 also need to be deleted. Specifically, theproduction array 20 may send an instruction to delete a file to the disaster recovery array, where the instruction includes the file name of the file and the latest serial number (the serial number corresponding to the last write operation). After receiving the instruction to delete the file, thedisaster recovery array 30 finds the corresponding backup file according to the file name, and determines whether the latest serial number of the backup file is the same as the serial number sent by theproduction array 20 . If the same, thedisaster recovery array 30 executes the operation of deleting the backup file; otherwise, the operation of deleting the backup file is not executed.

最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them.

Claims (10)

the disaster recovery array is further configured to receive data corresponding to the first replication task, create a backup file of the file, and write the initial data into the backup file, where a file name of the backup file is the same as a file name of the file; after receiving the data corresponding to the first replication task, receiving the data corresponding to the second replication task; determining that the file name corresponding to the second replication task is the same as the file name of the backup file, and judging whether the writing time of the modified data is later than the writing time of the initial data; and when the disaster recovery array determines that the writing time of the modified data is later than that of the initial data, writing the modified data into the backup file.
the disaster recovery array is further configured to receive data corresponding to the second replication task, create a backup file of the file, and write the modified data into the backup file, where a file name of the backup file is the same as a file name of the file; after receiving the data corresponding to the second replication task, receiving the data corresponding to the first replication task; determining that the file name corresponding to the first replication task is the same as the file name of the backup file, and judging whether the writing time of the initial data is later than the writing time of the modified data; and when the disaster recovery array determines that the writing time of the initial data is earlier than the writing time of the modified data, the operation of writing the initial data into the backup file is not executed.
CN201610971200.0A2016-10-282016-10-28 A remote data replication method, storage device and storage systemActiveCN106528338B (en)

Priority Applications (3)

Application NumberPriority DateFiling DateTitle
CN201610971200.0ACN106528338B (en)2016-10-282016-10-28 A remote data replication method, storage device and storage system
CN202010780943.6ACN112068992B (en)2016-10-282016-10-28 Remote data replication method, storage device and storage system
PCT/CN2017/081341WO2018076633A1 (en)2016-10-282017-04-21Remote data replication method, storage device and storage system

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610971200.0ACN106528338B (en)2016-10-282016-10-28 A remote data replication method, storage device and storage system

Related Child Applications (1)

Application NumberTitlePriority DateFiling Date
CN202010780943.6ADivisionCN112068992B (en)2016-10-282016-10-28 Remote data replication method, storage device and storage system

Publications (2)

Publication NumberPublication Date
CN106528338A CN106528338A (en)2017-03-22
CN106528338Btrue CN106528338B (en)2020-08-14

Family

ID=58325810

Family Applications (2)

Application NumberTitlePriority DateFiling Date
CN201610971200.0AActiveCN106528338B (en)2016-10-282016-10-28 A remote data replication method, storage device and storage system
CN202010780943.6AActiveCN112068992B (en)2016-10-282016-10-28 Remote data replication method, storage device and storage system

Family Applications After (1)

Application NumberTitlePriority DateFiling Date
CN202010780943.6AActiveCN112068992B (en)2016-10-282016-10-28 Remote data replication method, storage device and storage system

Country Status (2)

CountryLink
CN (2)CN106528338B (en)
WO (1)WO2018076633A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106528338B (en)*2016-10-282020-08-14华为技术有限公司 A remote data replication method, storage device and storage system
CN109164985B (en)*2018-08-272020-07-07华为技术有限公司Method for copying data, master device and slave device
CN109491980A (en)*2018-11-022019-03-19郑州云海信息技术有限公司A kind of remote replication method of file system, device, equipment and storage medium
CN109960613B (en)*2019-03-112023-05-12中国银联股份有限公司 Method and device for batch data processing
CN112395135B (en)*2020-11-302024-12-17福建安正智能科技有限公司Computer room server data backup method and device
CN115277376B (en)*2022-09-292022-12-23深圳华锐分布式技术股份有限公司Disaster recovery switching method, device, equipment and medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7624134B2 (en)*2006-06-122009-11-24International Business Machines CorporationEnabling access to remote storage for use with a backup program
CN102799475A (en)*2012-06-292012-11-28东南大学Multi-replication fault-tolerant parallel task scheduling method based on task replication
CN103617098A (en)*2013-12-032014-03-05上海爱数软件有限公司Intelligent backup method and system based on data changes
CN105988901A (en)*2013-12-122016-10-05华为技术有限公司Data copying method and storage system

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US8548944B2 (en)*2010-07-152013-10-01Delphix Corp.De-duplication based backup of file systems
CN104520802B (en)*2013-07-262017-04-19华为技术有限公司Data sending method, data receiving method and storage device
CN103649901A (en)*2013-07-262014-03-19华为技术有限公司Data transmission method, data receiving method and sotring equipment
CN105550367A (en)*2015-06-302016-05-04巫立斌Asynchronous remote copy method for memory
CN105404564A (en)*2015-12-162016-03-16浪潮(北京)电子信息产业有限公司Data remote disaster tolerance method and apparatus
CN106528338B (en)*2016-10-282020-08-14华为技术有限公司 A remote data replication method, storage device and storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7624134B2 (en)*2006-06-122009-11-24International Business Machines CorporationEnabling access to remote storage for use with a backup program
CN102799475A (en)*2012-06-292012-11-28东南大学Multi-replication fault-tolerant parallel task scheduling method based on task replication
CN103617098A (en)*2013-12-032014-03-05上海爱数软件有限公司Intelligent backup method and system based on data changes
CN105988901A (en)*2013-12-122016-10-05华为技术有限公司Data copying method and storage system

Also Published As

Publication numberPublication date
CN112068992A (en)2020-12-11
WO2018076633A1 (en)2018-05-03
CN106528338A (en)2017-03-22
CN112068992B (en)2025-01-03

Similar Documents

PublicationPublication DateTitle
US11461202B2 (en)Remote data replication method and system
CN106528338B (en) A remote data replication method, storage device and storage system
US10430286B2 (en)Storage control device and storage system
KR100439675B1 (en)An efficient snapshot technique for shated large storage
US9996421B2 (en)Data storage method, data storage apparatus, and storage device
US7293145B1 (en)System and method for data transfer using a recoverable data pipe
US8706694B2 (en)Continuous data protection of files stored on a remote storage device
US7882081B2 (en)Optimized disk repository for the storage and retrieval of mostly sequential data
US8924664B2 (en)Logical object deletion
US20080320258A1 (en)Snapshot reset method and apparatus
JP4741371B2 (en) System, server apparatus, and snapshot format conversion method
US10628298B1 (en)Resumable garbage collection
WO2018120844A1 (en)Differential data backup method and differential data backup device
US8140886B2 (en)Apparatus, system, and method for virtual storage access method volume data set recovery
JP6133396B2 (en) Computer system, server, and data management method
CN110825559A (en) A data processing method and device
JP2015049633A (en)Information processing apparatus, data repair program, and data repair method
JP2006268139A (en)Data reproduction device, method and program and storing system
JP4394467B2 (en) Storage system, server apparatus, and preceding copy data generation method
CN111400302B (en) Modification method, device and system for continuously storing data
CN112286869A (en)Snapshot creating method and device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp