CN113220212A - Storage node scheduling method and device, storage node, equipment and readable medium - Google Patents

Storage node scheduling method and device, storage node, equipment and readable medium Download PDF

Info

Publication number
CN113220212A
CN113220212A CN202010080120.2A CN202010080120A CN113220212A CN 113220212 A CN113220212 A CN 113220212A CN 202010080120 A CN202010080120 A CN 202010080120A CN 113220212 A CN113220212 A CN 113220212A
Authority
CN
China
Prior art keywords
request
data
write
storage device
log
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010080120.2A
Other languages
Chinese (zh)
Inventor
董元元
杨濮源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN202010080120.2A priority Critical patent/CN113220212A/en
Publication of CN113220212A publication Critical patent/CN113220212A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0604Improving or facilitating administration, e.g. storage management
    • G06F3/0607Improving or facilitating administration, e.g. storage management by facilitating the process of upgrading existing storage systems, e.g. for improving compatibility between host and storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • G06F3/0635Configuration or reconfiguration of storage systems by changing the path, e.g. traffic rerouting, path reconfiguration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0683Plurality of storage devices
    • G06F3/0685Hybrid storage combining heterogeneous device types, e.g. hierarchical storage, hybrid arrays

Abstract

The embodiment of the application provides a scheduling method and device of a storage node, the storage node, electronic equipment and a computer readable medium, and relates to the field of data storage. Wherein the method comprises the following steps: when the storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, acquiring characteristic data of the data write request; if the characteristic data is determined to meet the configured redirection condition of the write request, determining whether the running state of a second storage device in the storage node is suitable for the redirection operation of the data write request; and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data writing request, performing the redirection operation on the data writing request to write the data carried by the data writing request into the second storage device. Through the embodiment of the application, on the premise of meeting the service quality, the problem that the first storage device is too fast in abrasion due to too large data writing quantity is avoided, and the utilization rate of the second storage device is also improved.

Description

Storage node scheduling method and device, storage node, equipment and readable medium
Technical Field
The embodiment of the application relates to the field of data storage, in particular to a method and a device for scheduling a storage node, the storage node, electronic equipment and a computer readable medium.
Background
In the current large-scale data storage system, the hardware configuration, architecture and operation cost of the storage nodes are the important consideration of enterprises. Currently, people often use heterogeneous (structurally different) storage media to design heterogeneous storage nodes, so as to reduce the configuration cost of the storage nodes and ensure the service quality. Through the separation of cold data and hot data, the heterogeneous storage nodes place a small amount of hot data into a small-capacity high-performance cache so as to improve the read access quality of the hot data. Meanwhile, large-scale warm and cold data are put into a cheap and high-capacity storage device for persistence.
In the existing persistent storage system, due to the cache layer of the upper layer service and the content distribution network, hot data is absorbed, and the storage load of the bottom layer is often characterized in that write operation is higher than read operation. In a single heterogeneous storage node, the solid state disk is used as a write cache of a disk, namely most data are written to the solid state disk firstly, the access delay of the data is reduced by utilizing the high performance of the solid state disk, and the service quality is ensured; and then the data in the solid state disk is migrated to the disk for persistence. The hierarchical structure can meet the service requirement and reduce the persistence cost of the storage node. However, the repeated write strategy for the solid state disk not only causes the solid state disk to be worn out too fast, but also causes the disk to be in an idle state for a long time, and the bandwidth and the repeated write characteristics of the disk are not fully exerted, thereby causing the utilization rate of the disk to be low. Therefore, how to effectively solve the problem of data write balancing of storage devices with different read-write performances in the storage nodes becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The present application aims to provide a method and an apparatus for scheduling a storage node, an electronic device, and a computer readable medium, which are used to solve the technical problem of how to effectively solve the data write balancing of storage devices with different read/write performances in the storage node in the prior art.
According to a first aspect of embodiments of the present application, a method for scheduling storage nodes is provided. The method comprises the following steps: when a storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of second storage equipment in the storage node is suitable for the redirection operation of the data write request, wherein the read-write performance of the first storage equipment is superior to that of the second storage equipment; and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the second storage device.
According to a second aspect of the embodiments of the present application, there is provided a scheduling apparatus of a storage node. The device comprises: the first determining module is used for acquiring the characteristic data of a data write request and determining whether the characteristic data meets the configured write request redirection condition or not when the storage node receives the write request and judges that the write request is the data write request of a first storage device in the storage node; a second determining module, configured to determine whether an operating state of a second storage device in the storage node is suitable for a redirection operation of the data write request if it is determined that the feature data meets the write request redirection condition, where read-write performance of the first storage device is better than read-write performance of the second storage device; and the first writing module is used for executing redirection operation on the data writing request to write the data carried by the data writing request into the second storage device if the running state of the second storage device is determined to be suitable for the redirection operation of the data writing request.
According to a third aspect of embodiments of the present application, there is provided a storage node. The storage node includes: a scheduler disposed in the storage node, the scheduler specifically configured to: when the storage node receives a write request and judges that the write request is a data write request of a solid state disk in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of a disk in the storage node is suitable for the redirection operation of the data write request; and if the running state of the disk is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the disk.
According to a fourth aspect of embodiments of the present application, there is provided an electronic apparatus, including: one or more processors; a computer readable medium configured to store one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the method of scheduling of a storage node as described in the first aspect of the embodiments above.
According to a fifth aspect of embodiments of the present application, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements the scheduling method of the storage node according to the first aspect of the embodiments.
According to the scheduling scheme of the storage node provided by the embodiment of the application, when the storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, characteristic data of the data write request is obtained, and whether the characteristic data meets a configured write request redirection condition is determined; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of second storage equipment in the storage node is suitable for the redirection operation of the data write request, wherein the read-write performance of the first storage equipment is superior to that of the second storage equipment; if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, the redirection operation is executed on the data write request, so that the data carried by the data write request is written into the second storage device.
Drawings
Other features, objects and advantages of the present application will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings in which:
fig. 1A is a flowchart illustrating steps of a method for scheduling storage nodes according to an embodiment of the present disclosure;
FIG. 1B is a schematic diagram illustrating a scheduling process of a data write request of a first storage device according to an embodiment of the present application;
fig. 2A is a flowchart illustrating steps of a method for scheduling storage nodes according to a second embodiment of the present application;
FIG. 2B is a diagram illustrating a scheduling process of a write log request of a first storage device according to a second embodiment of the present disclosure;
FIG. 2C is a diagram illustrating a processing thread processing a write request according to a second embodiment of the present disclosure;
fig. 3A is a flowchart illustrating a method for scheduling storage nodes according to a third embodiment of the present application;
FIG. 3B is a schematic diagram of a scheduling process of a data write request of a second storage device according to a third embodiment of the present application;
fig. 4 is a schematic diagram of a scheduling process of a storage node according to a fourth embodiment of the present application;
fig. 5 is a schematic structural diagram of a scheduling apparatus of a storage node according to a fifth embodiment of the present application;
fig. 6 is a schematic structural diagram of a scheduling apparatus of a storage node according to a sixth embodiment of the present application;
fig. 7 is a schematic structural diagram of a scheduling apparatus of a storage node according to a seventh embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device in an eighth embodiment of the present application;
fig. 9 is a hardware configuration of an electronic device according to a ninth embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Referring to fig. 1A, a flowchart illustrating steps of a scheduling method for a storage node according to a first embodiment of the present application is shown.
Specifically, the method for scheduling storage nodes of this embodiment includes the following steps:
in step S101, when a storage node receives a write request and determines that the write request is a data write request of a first storage device in the storage node, feature data of the data write request is acquired.
In the embodiment of the present application, the storage nodes may be heterogeneous storage nodes, which may be understood as nodes composed of storage media with different structures. The first storage device and the second storage device can both be understood as devices for storing data, and the read-write performance of the first storage device is superior to that of the second storage device. For example, the first storage device may be a solid state disk and the second storage device may be a magnetic disk. The characteristic data may include at least one of: the size of the data carried by the data writing request, the sender of the data writing request and the file type of the data carried by the data writing request. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before the obtaining the characteristic data of the data write request, the method further includes: if the length of the obtained request queue of the first storage device exceeds a first preset length, marking the data write request as a redirection request, and determining whether the running state of the second storage device is suitable for the redirection operation of the data write request; and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the second storage device. The first preset length may be set by a person skilled in the art according to actual needs, and this is not limited in this embodiment of the application. Therefore, under the condition that the running state of the second storage device is suitable for redirection operation, data carried by the data writing request with the length of the request queue of the corresponding first storage device exceeding the first preset length is written into the second storage device, the problem that the first storage device is abraded too fast due to overlarge data writing quantity is further avoided, the utilization rate of the second storage device is further improved, and data writing balance of the storage devices with different read-write performances in the storage nodes is further guaranteed. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when a storage node receives an IO request for writing to a solid state disk, an IO scheduler obtains a length of a request queue of a destination solid state disk (a solid state disk corresponding to the IO request) of the current IO request, and if the length of the request queue exceeds a set threshold, a redirection tag is marked on the request. And if the running state of the disk meets the redirection operation of the request, the request with the redirection label is put into a disk request queue, and the data carried by the request is put into a disk write cache region. Otherwise, the redirection label of the request is cancelled, the redirection label is placed into a target solid state disk request queue, and the data carried by the request is placed into a solid state disk write cache region. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S102, it is determined whether the characteristic data satisfies the configured write request redirection condition.
In this embodiment of the application, the redirection condition may be a condition that needs to be satisfied by a data write request of a destination storage device, which is a first storage device, when data carried by the data write request of the destination storage device is stored in a second storage device. For example, when the characteristic data includes at least one of: when the size of the data carried by the data write request, the sender of the data write request, and the file type to which the data carried by the data write request belongs, the write request redirection condition includes at least one of the following: the size of the data carried by the data writing request exceeds a configured threshold, the sender of the data writing request is a set sender, and the file type to which the data carried by the data writing request belongs is a set file type. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before determining that the characteristic data satisfies the write request redirection condition, the method further comprises: and if the size of the data carried by the data writing request is determined to exceed a configured threshold, and/or the sender of the data writing request is a set sender, and/or the file type of the data carried by the data writing request is a set file type, determining that the feature data meets the condition of redirecting the writing request. Therefore, whether the characteristic data of the data writing request meets the configured writing request redirection condition or not can be accurately determined through the size of the data carried by the data writing request, the sender of the data writing request and the file type of the data carried by the data writing request. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when a storage node receives an IO request for writing to a solid state disk, and the length of a request queue of a destination solid state disk of the current IO request does not exceed a set threshold, an IO scheduler obtains a request characteristic of the IO request, and marks a redirection tag on a request meeting a redirection condition. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when the characteristic data includes a size of data carried by the data write request, the method further includes: collecting log data of a data writing request received by the storage node in a historical time period, and performing data analysis on the log data to obtain a static threshold value used for comparing the size of the data carried by the data writing request; if the fact that the number of the data writing requests of the second storage device in the current time period exceeds a preset number and the data volume carried by the data writing requests of the second storage device in the current time period exceeds a preset data volume is detected, increasing the static threshold value according to a preset proportion to obtain a dynamic threshold value used for comparing the size of the data carried by the data writing requests; and if the fact that the number of the data writing requests of the second storage device in the current time period does not exceed the preset number and the data volume carried by the data writing requests of the second storage device in the current time period does not exceed the preset data volume is detected, reducing the static threshold value according to a preset proportion to obtain a dynamic threshold value used for comparing the size of the data carried by the data writing requests. The preset number and the preset data amount may be set by a person skilled in the art according to actual needs, and this is not limited in this embodiment of the present application. Therefore, when the characteristic data comprises the size of the data carried by the data writing request, the threshold value compared with the size of the data carried by the data writing request can be dynamically adjusted according to the density of the data writing request of the second storage device. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, if the redirection condition satisfied by the data write request is that the size of the data carried by the request exceeds a set threshold, the threshold may change dynamically with the density of the data write request. Specifically, a static threshold T is set according to the size of data carried by a data write request in an offline request record, so that the processing time after the data write request with the size of data exceeding 90% of T is redirected to a disk can meet the service requirement. When the IO dispatcher operates on line and when the data writing request is dense, T is increased according to a certain proportion, and the data writing request which is possibly redirected is reduced so as to reduce the pressure of a disk; when the data writing request is sparse, T is reduced according to a certain proportion, and the data writing request which is possibly redirected is increased, so that the utilization rate of the disk is improved. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S103, if it is determined that the characteristic data satisfies the write request redirection condition, it is determined whether the operating state of a second storage device in the storage node is suitable for a redirection operation of the data write request.
In an embodiment of the present application, the operating state of the second storage device includes at least one of: the length of the request queue of the second storage device, the size of data to be written in a write buffer of the second storage device, the utilization rate of a storage space of the second storage device, and the average duration of writing data in the second storage device. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before determining that the operating status of the second storage device is suitable for the redirection operation of the data write request, the method further comprises: if the result of the determination includes at least one of: the length of the request queue of the second storage device does not exceed a second preset length, the size of data to be written in a write cache region of the second storage device does not exceed a preset threshold, the utilization rate of a storage space of the second storage device does not exceed a preset utilization rate threshold, and the average duration of data written by the second storage device does not exceed a first preset duration, then it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request. The second preset length, the preset threshold, the preset utilization rate threshold, and the first preset duration may be set by a person skilled in the art according to actual needs, which is not limited in this embodiment of the present application. Therefore, whether the running state of the second storage device is suitable for the redirection operation of the data write request can be accurately determined through the length of the request queue of the second storage device, the size of the data to be written in the write buffer area of the second storage device, the utilization rate of the storage space of the second storage device, or the average duration of the data writing of the second storage device. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the IO scheduler monitors the running state of the disk online, and if the running state of the disk meets the redirection operation of the data write request, places the data write request with the redirection tag into a disk request queue, and places the data carried by the data write request into a disk write cache region. Otherwise, the redirection tag of the data writing request is cancelled, the redirection tag is placed in a request queue of the target solid state disk, and the data carried by the data writing request is placed in a writing cache area of the solid state disk. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S104, if it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request, a redirection operation is performed on the data write request, so as to write the data carried by the data write request into the second storage device.
In some optional embodiments, when performing a redirection operation on the data write request to write data carried by the data write request into the second storage device, storing the data write request into a request queue of the second storage device, and storing data carried by the data write request into a write buffer of the second storage device; and polling the request queue of the second storage device by using a processing thread to acquire the data writing request in the request queue of the second storage device, acquiring data carried by the data writing request from a writing buffer area of the second storage device according to the size of the data carried by the data writing request, and writing the data carried by the data writing request into a file of the second storage device. Therefore, by using the processing thread to perform redirection operation on the data write request, the data carried by the data write request can be accurately written into the second storage device. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, after writing the data carried by the data write request into the second storage device, the method further includes: recording metadata of the data write request using the processing thread. Therefore, by recording the metadata of the data writing request, the data carried by the data writing request can be conveniently and accurately read and written for access. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the metadata of the data write request includes at least one of: the size of the data carried by the data writing request, the offset of the data carried by the data writing request in the file to which the data writing request belongs, and the physical address of the second storage device. When the processing thread is used for recording the metadata of the data writing request, the size of the data carried by the data writing request, the offset of the data carried by the data writing request in the file to which the data writing request belongs and the physical address of the second storage device form a new triple; taking the file name of the data carried by the data writing request as a key to query a hash table so as to determine whether the key exists in the hash table; and if the key exists in the hash table, acquiring a value corresponding to the key from the hash table, acquiring a linked list of the metadata of the file according to the value, and adding the value as a new node of the newly-built triple at the tail part of the linked list. By this, by using the hash table and the metadata linked list of the file, the metadata of the data write request can be accurately recorded. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the method further comprises: if the key does not exist in the hash table, creating a new linked list, and adding a value to the tail of the new linked list as a new node of the newly-built triple; and inserting a head pointer of the new linked list into the hash table as a value, and inserting a file name of the data carried by the data writing request into the hash table as a key. Therefore, under the condition that no corresponding key exists in the hash table, the metadata of the data writing request can be recorded in a mode of creating a new linked list, and the metadata of the data writing request can be accurately recorded. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In one specific example, a hash table is maintained in memory, where one key is the file name and the value is the file metadata index. The file metadata index points to metadata for the file. The metadata of the file is maintained by using a linked list, and the value of each node of the linked list is a triple consisting of the size of data carried by a data write request, the offset of the data carried by the data write request in the file to which the data write request belongs and the physical address of the storage device of the data carried by the data write request. And polling the request queue by the processing thread, acquiring a data write request from the request queue, taking out data from the write cache region according to the size of the data carried by the data write request, writing the data into the corresponding storage equipment, and recording the metadata of the data write request after the writing is finished. Specifically, after the data writing is completed, if the write request is a data write request, the processing thread first forms a triple of the size of the data carried by the data write request, the offset of the data carried by the data write request in the file to which the data write request belongs, and the physical address of the storage device of the data carried by the data write request. And then, inquiring a hash table by taking the file name of the file to which the data carried by the data writing request in the triple as a key, if the key does not exist, creating a new linked list, adding a new node with a value of the newly-created triple at the tail part of the new linked list, and finally inserting the head pointer of the new linked list into the hash table by taking the head pointer of the new linked list as a value and the file name of the file to which the data carried by the data writing request belongs as a key. And if the key exists, acquiring a value corresponding to the key, acquiring a file metadata linked list according to the value, and adding the value as a new node of the newly-built triple at the tail part of the linked list. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, when the number of the second storage devices in which the running status is suitable for the redirection operation of the data write request is plural, the method further includes: and selecting the second storage equipment used for writing the data carried by the data writing request from the plurality of second storage equipment by adopting a load balancing principle or a load concentration principle. Therefore, by adopting a load balancing principle or a load concentration principle, the second storage device suitable for writing the data carried by the data writing request can be accurately selected from the plurality of second storage devices. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In one specific example, the IO scheduler may select a destination storage device from a set of storage devices for a request according to the following two principles. The load balancing principle may be understood as a principle of ensuring that the amount of data per storage device is balanced. Specifically, the IO scheduler obtains the capacity utilization rates of all second storage devices whose running states satisfy the redirection operation of the data write request at the current time, then calculates an average capacity utilization rate, and randomly allocates one second storage device to the data write request from the second storage devices whose current capacity utilization rate is less than the average capacity utilization rate and whose remaining capacity is greater than the size of data carried by the data write request. The load concentrating principle can be understood as a principle of preferentially filling up the storage space of one storage device. Specifically, the IO scheduler obtains the capacity utilization rates of all the second storage devices whose running states satisfy the redirection operation of the data write request at the current time and sorts the capacity utilization rates from large to small, and preferentially allocates the second storage device with the large capacity utilization rate to the data write request under the condition that the remaining capacity of the second storage device is larger than the size of data carried by the data write request. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S105, if it is determined that the characteristic data does not satisfy the condition for redirecting the write request or the operating state of the second storage device is not suitable for the operation for redirecting the data write request, writing the data carried in the data write request into the corresponding first storage device.
In a specific example, as shown in fig. 1B, it is assumed that the write request redirection condition is that the size of data carried by the data write request exceeds a set threshold T, and the condition that the running state of the disk satisfies the redirection operation of the data write request is that the length of the request queue of the disk does not exceed a set threshold L. The specific flow steps when the storage node receives the IO request for writing the solid state disk are as follows: (1) the storage node receives an IO request for writing the solid state disk, an IO dispatcher acquires the length of a request queue of a target solid state disk S of the current IO request, if the length is larger than a set threshold value, turning to (4), otherwise, turning to (2); (2) the IO scheduler obtains the size of data carried by the data writing request, and then the step (3) is carried out; (3) whether the size of data carried by the data writing request is larger than a set threshold value T or not is judged, if yes, the step (4) is carried out, and if not, the step (7) is carried out; (4) the IO dispatcher acquires the lengths of the request queues of all the disks, judges whether the lengths of the request queues exceed a set threshold value L or not, if so, turns to (7), and otherwise, turns to (5); (5) the IO scheduler obtains the capacity utilization rate of the disk of which the current queue length does not exceed a set threshold value L at the current moment, then calculates the average capacity utilization rate, and randomly selects a disk H from the disks of which the current capacity utilization rate is less than the average capacity utilization rate and the residual capacity is greater than the size of data carried by a data writing request, and then (6); (6) the IO dispatcher inserts the data write request into a request queue of a disk H, and then (8) is carried out; (7) the IO dispatcher inserts the data writing request into a request queue of a target solid state disk S, and then (8) is carried out; (8) and finishing the scheduling. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
According to the scheduling method of the storage node provided by the embodiment of the application, when the storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, characteristic data of the data write request is obtained, and whether the characteristic data meets a configured write request redirection condition is determined; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of second storage equipment in the storage node is suitable for the redirection operation of the data write request, wherein the read-write performance of the first storage equipment is superior to that of the second storage equipment; if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, the redirection operation is executed on the data write request, so that the data carried by the data write request is written into the second storage device.
The scheduling method of the storage node of the present embodiment may be executed by any suitable device with data processing capability, including but not limited to: cameras, terminals, mobile terminals, PCs, servers, in-vehicle devices, entertainment devices, advertising devices, Personal Digital Assistants (PDAs), tablet computers, notebook computers, handheld game consoles, smart glasses, smart watches, wearable devices, virtual display devices or display enhancement devices (such as Google Glass, Oculus rise, Hololens, Gear VR), and the like.
Referring to fig. 2A, a flowchart illustrating steps of a method for scheduling a storage node according to a second embodiment of the present application is shown.
Specifically, the method for scheduling storage nodes of this embodiment includes the following steps:
in step S201, when the write request received by the storage node is a write log request of the first storage device, the write log request is cached in a log file of a write log cache region.
In the embodiment of the present application, the storage nodes may be heterogeneous storage nodes, that is, nodes composed of storage media with different structures. The log write request can be understood as a request for writing the carried log data. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, after storing the write log request in a log file of a write log cache, the method further includes: and recording the file name of the log file to which the write log request belongs and the offset of the write log request in the log file to which the write log request belongs. Therefore, the log data carried by the write log request can be conveniently and accurately read and written for access by recording the file name of the log file to which the write log request belongs and the offset of the write log request in the log file to which the write log request belongs. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S202, when the write log cache area is full, a merge operation is performed on the write log request in the log file of the write log cache area to obtain a large write log request.
In this embodiment of the present application, when the remaining capacity of the cache space of the write log cache area is zero, a merge operation may be performed on the write log request in the log file of the write log cache area based on the metadata of the write log request, so as to obtain a large write log request. Wherein the metadata of the write log request may include at least one of: the file name of the log file to which the write log request belongs and the offset of the write log request in the log file to which the write log request belongs. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S203, when it is determined that the operating state of the second storage device is suitable for the redirection operation of the large write log request, a redirection operation is performed on the large write log request, so as to write the log data carried by the large write log request into the second storage device.
In this embodiment of the present application, a specific implementation manner of determining whether the operating state of the second storage device is suitable for the redirection operation of the large write log request is similar to the specific implementation manner of determining whether the operating state of the second storage device is suitable for the redirection operation of the data write request in the first embodiment, and details are not repeated here. The specific implementation manner of performing the redirection operation on the large write log request to write the log data carried by the large write log request into the second storage device is similar to the specific implementation manner of performing the redirection operation on the data write request to write the data carried by the data write request into the second storage device in the first embodiment, and details are not repeated here. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when a storage node receives a write log request which is sent to a solid state disk and has a dense request interval, the same size and a smaller size, an IO scheduler puts the write log request into a write log cache region with a fixed size, and records an offset of the write log request in a log file to which the write log request belongs and a file name of the log file to which the write log request belongs. When the write log cache area is full, a plurality of write log requests in the log file of the write log cache area are combined into one large write log request. When the running state of the disk meets the redirection operation of the large write log request, putting the large write log request into a disk request queue, and putting log data (log data carried by the large write log request) in a write log cache region into a disk write cache region; otherwise, the large write log request is put into a solid state disk request queue, and log data in a write log cache region (log data carried by the large write log request) is put into the solid state disk write cache region. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, the method further comprises: when the write request received by the storage node is a write log request of the first storage device, caching the write log request into a log file of a write log cache region; polling the state set for the write log cache region by the allocated cache monitoring thread; and based on the state, executing persistent storage operation on log data carried by the write log request in the log file of the write log cache region. Therefore, the persistent storage operation is performed on the log data carried by the write log request in the log file of the write log cache area through the state set for the write log cache area by the buffer monitoring thread distributed in a polling mode and based on the state set for the write log cache area by the buffer monitoring thread, and the efficiency of performing the persistent storage operation on the log data carried by the write log request in the log file of the write log cache area can be effectively improved. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In some optional embodiments, before polling the state set by the allocated cache monitor thread for the write log cache region, the method further comprises: if the write log cache region is full and the difference value between the current time point and the time point of the first write log request cached in the write log cache region is less than a second preset time length, using the cache monitoring thread distributed for the write log cache region to update the state of the write log cache region to a preparation state; and if the difference value between the current time point and the time point of the first write log request cached in the write log cache region is greater than or equal to a second preset time length, updating the state of the write log cache region into a dump state by using the cache monitoring thread distributed for the write log cache region. The second preset time period may be set by a person skilled in the art according to actual needs, and this is not limited in this embodiment of the application. Therefore, the state of the write log cache region can be accurately updated by the cache monitoring thread of the write log cache region through the residual capacity of the write log cache region, the current time point, the time point of the first write log request cached by the write log cache region and the second preset time length. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the IO scheduler sets a time threshold for writing log data in the log cache region, and allocates a cache monitoring thread to monitor the status of the log cache region. And the cache monitoring thread sets a mark to represent the current state of the write log cache region, the state is visible to the IO scheduler, and the initial state is a waiting state. When a first write log request is written in the write log cache region, the cache monitoring thread records the arrival time of the request as a starting time point. And if the write log cache region is full and the difference value between the current time and the starting time point is less than the set time threshold, the cache monitoring thread updates the state of the write log cache region to a preparation state. If the difference between the current time and the starting time point is greater than or equal to the set time threshold, the cache monitoring thread updates the state of the write log cache area to a dump state no matter whether the write log cache area is full or not. The purpose of setting the time threshold is to try to aggregate log data, large block writes, during this time. If the time threshold is exceeded, the log data written in the log cache area must be persisted without being aggregated enough log data, so that the reliability of the log data is ensured. In addition, the log writing request has certain timeliness, the request result can be returned after log data are stored persistently, and the failure of the log writing request cannot be caused by the overlong aggregation time of the log data in the log writing cache region. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when performing persistent storage operation on log data carried by the write log request in the log file of the write log cache area based on the state, when the state is the preparation state, performing merge operation on the write log request in the log file of the write log cache area to obtain a large write log request; and when the running state of the second storage device is determined to be suitable for the redirection operation of the large write log request, executing the redirection operation on the large write log request so as to write the log data carried by the large write log request into the second storage device. Therefore, under the condition that the running state of the second storage device is suitable for redirection operation, log data carried by a write log request originally sent to the first storage device is written into the second storage device, on the premise that the write log request meets the service quality, the problem that the first storage device is abraded too fast due to overlarge data writing quantity is further avoided, the utilization rate of the second storage device is further improved, and therefore data writing balance of storage devices with different read-write performances in the storage node is further guaranteed. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when the number of the second storage devices in which the running status is suitable for the redirection operation of the large write log request is multiple, the method further includes: and selecting the second storage equipment used for writing the log data carried by the large write log request from the plurality of second storage equipment by adopting a load balancing principle or a load centralizing principle. Therefore, by adopting a load balancing principle or a load concentration principle, the second storage device suitable for writing the log data carried by the write log request can be accurately selected from the plurality of second storage devices. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, when performing persistent storage operation on log data carried by the write log request in the log file of the write log cache area based on the state, when the state is the dump state, performing merge operation on the write log request in the log file of the write log cache area to obtain a large write log request; and selecting the first storage equipment used for writing the log data carried by the large write log request from the plurality of first storage equipment by adopting a load balancing principle or a load concentration principle. Therefore, by adopting a load balancing principle or a load concentration principle, the first storage device suitable for writing the log data carried by the write log request can be accurately selected from the plurality of first storage devices. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, the IO scheduler polls a state set for the write log cache by the cache monitoring thread, and merges a plurality of write log requests in the write log cache into one large write log request when the polled state is in a ready state. When the running state of the disk meets the redirection operation of a large write log request, putting the request into a disk request queue, and putting log data (log data carried by the large write log request) in a write log cache region into a disk write cache region; otherwise, the request is put into a request queue of the solid state disk, and the log data in the write log cache region (the log data carried by the large write log request) is put into the write cache region of the solid state disk. When the polled state is a dump state, the IO scheduler merges all the write log requests in the write log cache region into one large write log request, puts the large write log request into a request queue of the solid state disk, and puts the log data (the log data carried by the large write log request) in the write log cache region into the write cache region of the solid state disk. And finally, the IO scheduler updates the state of the write log cache region into a waiting state. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, as shown in fig. 2B, it is assumed that the running state of the disk satisfies the condition that the redirection operation of the write log request is that the length of the disk request queue does not exceed the set threshold L. The specific process steps when the storage node receives a write log request sent to the solid state disk are as follows: (1) the storage node receives a log writing request of the solid state disk, and then the step (2) is carried out; (2) the IO dispatcher caches the log data carried by the request to a write log cache region, if the request is the first write log request of the write log cache region, the cache monitoring thread records the time point of arrival of the request as a starting time point, and then the step (3) is carried out; (3) judging whether the difference value between the current time point and the starting time point is smaller than a set time threshold, if the difference value is smaller than the set time threshold, turning to (4), if the difference value is larger than or equal to the set time threshold, updating the state of the write log cache region into a dump state by the cache monitoring thread, and turning to (8); (4) if the write log cache region is full, the cache monitoring thread updates the state of the write log cache region to be a preparation state, and then the operation is carried out (5) and the operation is not carried out (12); (5) merging a plurality of write log requests in a write log cache region into a large write log request by an IO dispatcher, acquiring the length of a request queue of all disks, judging whether the disks with the queue length exceeding a set threshold value L exist, if so, turning to (9), otherwise, turning to (6); (6) the IO dispatcher acquires the capacity utilization rate of the disk of which the length of the request queue does not exceed a set threshold value L at the current moment, then calculates the average capacity utilization rate, and randomly selects a disk H' from the disks of which the current capacity utilization rate is less than the average capacity utilization rate and the residual capacity is greater than the size of log data carried by a large write log request, and then turns to (7); (7) the IO dispatcher places the large write log request into a request queue of a disk H', and then (11) is carried out; (8) the IO dispatcher merges a plurality of write log requests in the write log cache region into a large write log request, and then the large write log request is converted into a large write log request (9); (9) the IO scheduler obtains the capacity utilization rates of all the solid state disks at the current moment, then calculates the average capacity utilization rate, and randomly selects one solid state disk S' from the solid state disks with the current capacity utilization rate smaller than the average capacity utilization rate and the residual capacity larger than the size of log data carried by the combined request, and then the operation is carried out (10); (10) the IO dispatcher puts the large write log request into a request queue of the solid state disk S', and then (11) is carried out; (11) the IO scheduler updates the state of the write log cache region into a waiting state, and then the operation is carried out (12); (12) and finishing the scheduling. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, as shown in fig. 2C, the specific flow steps of processing a write request in a request queue by a processing thread are as follows: (1) a processing thread polling request queue acquires a write request, and acquires data to be written from a corresponding write cache region according to the size of the data carried by the write request and writes the data into a target storage device; (2) after the writing is finished, if the request type is a non-write log request, a triple is formed by the size of data carried by the request, the offset of the data carried by the request in the file to which the request belongs and the physical address of the storage device of the data carried by the request, and then the step (3) is carried out, otherwise, the step (5) is carried out; (3) taking the file name of the file to which the data carried in the triple belongs as a key to inquire the hash table, if the key does not exist, creating a new linked list, adding a value as a new node of the newly-created triple at the tail of the linked list, and finally inserting a head pointer of the linked list as a value and the file name of the file to which the data carried in the request belongs into the hash table together as a key, wherein a turn (4) exists; (4) acquiring a value corresponding to the key, acquiring a file metadata linked list according to the value, and adding a value as a new node of a newly-established triple at the tail of the linked list; (5) respectively forming a plurality of triples according to the size of log data carried by each recorded write log request, the offset of the log data carried by each write log request in a file to which the log data belongs and the physical address of the storage device of the log data carried by each write log request, and repeating the steps (3) and (4) until each small write log request in the large write log request is processed; (6) the processing request ends. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
According to the scheduling method of the storage node provided by the embodiment of the application, when the write request received by the storage node is the write log request of the first storage device, the write log request is cached in the log file of the write log cache region; when the write log cache region is full, executing merging operation on the write log requests in the log files of the write log cache region to obtain large write log requests; when the operating state of the second storage device is determined to be suitable for the redirection operation of the large write log request, the redirection operation is performed on the large write log request, so that log data carried by the large write log request is written into the second storage device.
The scheduling method of the storage node of the present embodiment may be executed by any suitable device with data processing capability, including but not limited to: cameras, terminals, mobile terminals, PCs, servers, in-vehicle devices, entertainment devices, advertising devices, Personal Digital Assistants (PDAs), tablet computers, notebook computers, handheld game consoles, smart glasses, smart watches, wearable devices, virtual display devices or display enhancement devices (such as Google Glass, Oculus rise, Hololens, Gear VR), and the like.
Referring to fig. 3A, a flowchart illustrating steps of a scheduling method for a storage node according to a third embodiment of the present application is shown.
Specifically, the method for scheduling storage nodes of this embodiment includes the following steps:
in step S301, when the current write request received by the storage node is a data write request of the first storage device, and a last write request received by the storage node is a data write request of the second storage device, acquiring feature data of the current write request.
In the embodiment of the present application, the storage nodes may be heterogeneous storage nodes, which may be understood as nodes composed of storage media with different structures. The first storage device and the second storage device can both be understood as devices for storing data, and the read-write performance of the first storage device is superior to that of the second storage device. For example, the first storage device may be a solid state disk and the second storage device may be a magnetic disk. The characteristic data may include at least one of: the size of the data carried by the data writing request, the sender of the data writing request and the file type of the data carried by the data writing request. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S302, it is determined whether the feature data of the current write request satisfies the configured write request redirection condition.
In this embodiment of the application, the redirection condition may be understood as a condition that the destination storage device needs to satisfy the current write request of the first storage device when storing data carried by the current write request of the destination storage device, which is the first storage device, to the second storage device. For example, when the characteristic data includes at least one of: when the size of the data carried by the current write request, the sender of the current write request, and the file type to which the data carried by the current write request belongs, the write request redirection condition includes at least one of the following: the size of the data carried by the current write request exceeds a configured threshold, the sender of the current write request is a set sender, and the file type to which the data carried by the current write request belongs is a set file type. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In step S303, if it is determined that the characteristic data does not satisfy the condition for redirecting the write request, it is determined whether the size of the data to be written in the write cache area of the second storage device corresponding to the previous write request exceeds a configured threshold.
Since the specific implementation of step S303 is similar to the specific implementation of step S103, it is not described herein again.
In step S304, if it is determined that the size of the data to be written in the write cache area of the second storage device corresponding to the previous write request does not exceed the configured threshold, a redirection operation is performed on the current write request, so as to write the data carried by the current write request into the second storage device corresponding to the previous write request.
Since the specific implementation of step S304 is similar to the specific implementation of step S104, it is not described herein again.
In step S305, if it is determined that the feature data meets the condition for redirecting the write request, or the size of the data to be written in the write cache area of the second storage device corresponding to the previous write request exceeds a configured threshold, writing the data carried in the current write request into the corresponding first storage device.
Since the embodiment of step S305 is similar to that of step S105, it is not repeated herein.
In a specific example, when a node receives a disk write IO request, the request directly enters a destination disk request queue without passing through an IO scheduler, and data included in the request is placed in a disk write buffer. When the next write solid state disk request arrives, if the request characteristics do not meet the redirection requirement, the IO scheduler judges whether the length of the data to be written in the current disk write cache region exceeds a set threshold value, if not, the request is marked with a redirection tag and is placed into a disk request queue, and the data contained in the request is placed into the disk write cache region; otherwise, the data is put into a solid state disk request queue, and the data contained in the request is put into a solid state disk write cache region. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
In a specific example, as shown in fig. 3B, the specific steps of the flow when the storage node receives a data write request sent to the disk are as follows: (1) when a storage node receives a data write request sent to a disk, the data write request directly enters a request queue of a target disk (a disk corresponding to the data write request), and data carried by the data write request is placed in a disk write cache region; (2) if the next data writing request is a request for writing the solid state disk, if the characteristics of the request do not meet the redirection condition, turning to (3); (3) the IO scheduler judges whether the size of data to be written in a write cache region of a current disk exceeds a set threshold, if not, the operation is carried out (4), otherwise, the operation is carried out (5); (4) the request is marked with a redirection label and is put into a disk request queue, and the data carried by the request is put into a disk write cache region; (5) and putting the request into a solid state disk request queue, and putting data carried by the request into a solid state disk write cache region. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
According to the scheduling method of the storage node provided by the embodiment of the application, when the current write request received by the storage node is a data write request of a first storage device and the last write request received by the storage node is a data write request of a second storage device, the characteristic data of the current write request is obtained, and whether the characteristic data of the current write request meets the configured write request redirection condition or not is determined; if the characteristic data is determined not to meet the redirection condition of the write request, determining whether the size of the data to be written in the write cache region of the second storage device corresponding to the last write request exceeds a configured threshold value; if the data to be written in the write cache region of the second storage device corresponding to the last write request is determined not to exceed the configured threshold value, then, a redirection operation is performed on the current write request, so as to write the data carried by the current write request into the second storage device corresponding to the last write request, compared with the existing other ways, under the condition that the size of the data to be written in the write cache region of the second storage device corresponding to the last write request does not exceed the configured threshold value, the data carried by the current write request which is originally sent to the first storage equipment and has the characteristics that the redirect condition is not met is written into the second storage equipment corresponding to the last write request, so that the problem that the first storage equipment is abraded too fast due to the overlarge write data amount is further avoided, the utilization rate of the second storage equipment is further improved, therefore, data write-in balance of storage devices with different read-write performances in the storage nodes is further guaranteed.
The scheduling method of the storage node of the present embodiment may be executed by any suitable device with data processing capability, including but not limited to: cameras, terminals, mobile terminals, PCs, servers, in-vehicle devices, entertainment devices, advertising devices, Personal Digital Assistants (PDAs), tablet computers, notebook computers, handheld game consoles, smart glasses, smart watches, wearable devices, virtual display devices or display enhancement devices (such as Google Glass, Oculus rise, Hololens, Gear VR), and the like.
An embodiment of the present application provides a storage node, where the storage node includes: a scheduler disposed in the storage node, the scheduler specifically configured to: when the storage node receives a write request and judges that the write request is a data write request of a solid state disk in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of a disk in the storage node is suitable for the redirection operation of the data write request; and if the running state of the disk is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the disk.
In a specific example, as shown in fig. 4, a single heterogeneous storage node includes a group of solid state disks, a group of disks, an IO scheduler, a group of processing threads, and a memory including a hash table, a write cache region, a write log cache region, a request queue corresponding to each solid state disk, and a request queue corresponding to each disk. The hash table is maintained in the memory, and is used for recording the file name of the data file to which the data carried by the write request belongs, the size of the data carried by the write request, the offset of the data carried by the write request in the data file to which the data belongs, and the physical address of the write storage device of the data carried by the write request, and needs to be periodically persisted to the nonvolatile storage device. The write cache region is a buffer region in the memory for temporarily storing data to be written carried by a write request sent to the solid state disk or the magnetic disk. The write log cache region is a buffer region used for temporarily storing log data carried by a write log request sent to the solid state disk in the memory. The solid state disk request queue is a queue for storing data write requests sent to the solid state disks, and each solid state disk corresponds to one solid state disk request queue. The disk request queue is a queue for storing data write requests sent to the disks, and each disk corresponds to one disk request queue. And the processing thread is used for processing the data write request or the write log request in the request queue, writing the data in the write cache region into the corresponding storage device, and recording the file name of the file to which the data carried by the write request belongs, the size of the data carried by the write request, the offset of the data carried by the write request in the file to which the data belongs and the physical address of the write device of the data carried by the write request into the metadata linked list after the write is completed. The IO dispatcher is used for not directly placing the solid state disk write requests sent by all users into the solid state disk request queue according to the length of the request queue of the current solid state disk, the running state of the disk and the characteristic data of the write requests, but placing the corresponding solid state disk write requests into the disk request queue when the characteristic data meets the redirection condition and the running state of the disk meets the redirection operation of the write requests. The storage node scheduling process is as follows: when an IO request for writing the solid state disk arrives, an IO dispatcher acquires the request characteristics of the IO request, and when the disk state meets the redirection operation of the request, the IO request with the request characteristics meeting the redirection condition is placed in a disk request queue, and data carried by the IO request is placed in a disk write cache region; otherwise, the request is put into a request queue of the solid state disk, and the data carried by the request is put into a write cache region of the solid state disk. When a write log IO request arrives, the IO scheduler puts the write log IO request into a write log cache region, when the write log cache region is full, a plurality of write log IO requests are combined into a large write log IO request, when the running state of a disk meets the redirection operation of the large write log IO request, the large write log IO request is put into a disk request queue, otherwise, the large write log IO request is put into a solid state disk request queue. When an IO request for writing a disk arrives, the request directly enters a disk request queue, if the subsequent request is a request for writing a solid state disk and the characteristics of the request do not meet redirection conditions, an IO scheduler judges whether the length of data to be written in a current disk write cache region exceeds a threshold value or not, if the length of the data to be written in the current disk write cache region does not exceed the threshold value, the request is placed in the disk request queue, otherwise, the request is placed in the solid state disk request queue. Compared with the existing low-delay persistence strategy, the data carried by the write request is written into the solid state disk firstly, and then the data is transferred from the solid state disk to the disk, so that the solid state disk is worn out too fast, the utilization rate of the disk is not high, and further the data writing of the solid state disk and the disk in the storage node is unbalanced. According to the scheme, through an IO scheduling strategy based on the operation state of the monitoring disk, the IO request which is originally sent to the solid state disk and meets the redirection condition is written into the disk under the condition that the operation state of the disk meets the redirection operation of the write request, the write data volume of the solid state disk is reduced, the sequential write bandwidth of the disk is fully utilized on the premise that the IO request meets the service quality requirement, and therefore the data write balance of the solid state disk and the disk in the storage node is effectively guaranteed. It should be understood that the above description is only exemplary, and the embodiments of the present application are not limited in this respect.
The storage node of this embodiment is used to implement the corresponding scheduling method of the storage node in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
Referring to fig. 5, a schematic structural diagram of a scheduling apparatus for a storage node in the fourth embodiment of the present application is shown.
The scheduling apparatus of a storage node of this embodiment includes: a first determining module 401, configured to, when a storage node receives a write request and determines that the write request is a data write request of a first storage device in the storage node, obtain feature data of the data write request, and determine whether the feature data meets a configured write request redirection condition; a second determining module 402, configured to determine whether an operating state of a second storage device in the storage node is suitable for a redirection operation of the data write request if it is determined that the feature data meets the write request redirection condition, where read-write performance of the first storage device is better than read-write performance of the second storage device; a first writing module 403, configured to, if it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request, perform a redirection operation on the data write request, so as to write the data carried by the data write request into the second storage device.
The scheduling apparatus of a storage node in this embodiment is used to implement the corresponding scheduling method of a storage node in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
Referring to fig. 6, a schematic structural diagram of a scheduling apparatus for a storage node in the fifth embodiment of the present application is shown.
The scheduling apparatus of a storage node of this embodiment includes: a first determining module 503, configured to, when a storage node receives a write request and determines that the write request is a data write request of a first storage device in the storage node, obtain feature data of the data write request, and determine whether the feature data meets a configured write request redirection condition; a second determining module 505, configured to determine whether an operating state of a second storage device in the storage node is suitable for a redirection operation of the data write request if it is determined that the feature data meets the write request redirection condition, where read-write performance of the first storage device is better than read-write performance of the second storage device; a first writing module 508, configured to, if it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request, perform a redirection operation on the data write request, so as to write the data carried by the data write request into the second storage device.
Optionally, before the first determining module 503, the apparatus further includes: a third determining module 501, configured to mark the data write request as a redirection request and determine whether an operating state of the second storage device is suitable for redirection operation of the data write request if the length of the request queue of the first storage device corresponding to the obtained data write request exceeds a first preset length; a second writing module 502, configured to, if it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request, perform a redirection operation on the data write request, so as to write the data carried by the data write request into the second storage device.
Optionally, the characteristic data comprises at least one of: before the second determining module 505, the apparatus further includes: a fourth determining module 504, configured to determine that the feature data meets the condition for redirecting the write request if it is determined that the size of the data carried by the data write request exceeds a configured threshold, and/or the sender of the data write request is a set sender, and/or the file type to which the data carried by the data write request belongs is a set file type.
Optionally, when the characteristic data includes a size of data carried by the data write request, the apparatus further includes: an analyzing module 509, configured to collect log data of the data write request received by the storage node in a historical time period, and perform data analysis on the log data to obtain a static threshold value used for comparing the size of the data carried in the data write request; an increasing module 510, configured to increase the static threshold according to a preset ratio to obtain a dynamic threshold for comparing with the size of the data carried by the data write request, if it is detected that the number of data write requests of the second storage device in the current time period exceeds a preset number, and the amount of data carried by the data write requests of the second storage device in the current time period exceeds a preset amount of data; a reducing module 511, configured to reduce the static threshold according to a preset ratio to obtain a dynamic threshold for comparing with the size of the data carried by the data write request, if it is detected that the number of data write requests of the second storage device in the current time period does not exceed a preset number, and the data amount carried by the data write requests of the second storage device in the current time period does not exceed a preset data amount.
Optionally, the operating state of the second storage device comprises at least one of: the length of the request queue of the second storage device, the size of data to be written in the write buffer of the second storage device, the usage rate of the storage space of the second storage device, and the average duration of writing data in the second storage device, before the first writing module 508, the apparatus further includes: a fifth determining module 506, configured to, if the result of the determination includes at least one of: the length of the request queue of the second storage device does not exceed a second preset length, the size of data to be written in a write cache region of the second storage device does not exceed a preset threshold, the utilization rate of a storage space of the second storage device does not exceed a preset utilization rate threshold, and the average duration of data written by the second storage device does not exceed a first preset duration, then it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request.
Optionally, when the number of the second storage devices in the running state suitable for the redirection operation of the data write request is multiple, the apparatus further includes: a first selecting module 507, configured to select, by using a load balancing principle or a load concentrating principle, the second storage device used for writing the data carried by the data write request from the multiple second storage devices.
Optionally, the apparatus further comprises: a first caching module 512, configured to cache, when a write request received by the storage node is a write log request of the first storage device, the write log request in a log file in a write log cache region; a merging module 513, configured to, when the write log cache area is full, perform a merging operation on the write log request in the log file of the write log cache area to obtain a large write log request; a third writing module 514, configured to, when it is determined that the running state of the second storage device is suitable for the redirection operation of the large write log request, perform a redirection operation on the large write log request, so as to write the log data carried by the large write log request into the second storage device.
Optionally, after the third writing module 514, the apparatus further includes: the recording module 515 is configured to record a file name of a log file to which the write log request belongs and an offset of the write log request in the log file to which the write log request belongs.
The scheduling apparatus of a storage node in this embodiment is used to implement the corresponding scheduling method of a storage node in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
Referring to fig. 7, a schematic structural diagram of a scheduling apparatus for a storage node in a sixth embodiment of the present application is shown.
The scheduling apparatus of a storage node of this embodiment includes: a first determining module 601, configured to, when a storage node receives a write request and determines that the write request is a data write request of a first storage device in the storage node, obtain feature data of the data write request, and determine whether the feature data meets a configured write request redirection condition; a second determining module 602, configured to determine whether an operating state of a second storage device in the storage node is suitable for a redirection operation of the data write request if it is determined that the feature data meets the write request redirection condition, where read-write performance of the first storage device is better than read-write performance of the second storage device; a first writing module 603, configured to, if it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request, perform a redirection operation on the data write request, so as to write the data carried in the data write request into the second storage device.
Optionally, the apparatus further comprises: a second caching module 607, configured to cache, when the write request received by the storage node is a write log request of the first storage device, the write log request in a log file in a write log cache region; a polling module 610, configured to poll a state set for the write log cache region by an allocated cache monitoring thread; and a persistence module 612, configured to execute a persistent storage operation on log data carried by the write log request in the log file of the write log cache area based on the state.
Optionally, before the polling module 610, the apparatus further includes: a first updating module 608, configured to update a state of the write log cache area to a ready state by using the cache monitoring thread allocated to the write log cache area if the write log cache area is full and a difference between a current time point and a time point of the first write log request cached by the write log cache area is less than a second preset time length; a second updating module 609, configured to update the state of the write log cache area to a dump state by using the cache monitoring thread allocated to the write log cache area if a difference between a current time point and a time point of the first write log request cached in the write log cache area is greater than or equal to a second preset time duration.
Optionally, the persistence module 612 is specifically configured to: when the state is the preparation state, executing a merging operation on the write log request in the log file of the write log cache region to obtain a large write log request; and when the running state of the second storage device is determined to be suitable for the redirection operation of the large write log request, executing the redirection operation on the large write log request so as to write the log data carried by the large write log request into the second storage device.
Optionally, when the number of the second storage devices in which the running status is suitable for the redirection operation of the large write log request is multiple, the apparatus further includes: a second selecting module 611, configured to select, from the multiple second storage devices, the second storage device for writing the log data carried by the large write log request by using a load balancing principle or a load concentrating principle.
Optionally, the persistence module 612 is specifically configured to: when the state is the dump state, executing a merging operation on the write log request in the log file of the write log cache region to obtain a large write log request; and selecting the first storage equipment used for writing the log data carried by the large write log request from the plurality of first storage equipment by adopting a load balancing principle or a load concentration principle.
Optionally, the apparatus further comprises: a sixth determining module 604, configured to, when a current write request received by the storage node is a data write request of the first storage device and a last write request received by the storage node is a data write request of the second storage device, obtain feature data of the current write request, and determine whether the feature data of the current write request meets a configured write request redirection condition; a seventh determining module 605, configured to determine whether the size of the data to be written in the write cache region of the second storage device corresponding to the previous write request exceeds a configured threshold if it is determined that the characteristic data does not satisfy the write request redirection condition; a fourth writing module 606, configured to, if it is determined that the size of the data to be written in the write cache area of the second storage device corresponding to the previous write request does not exceed the configured threshold, perform a redirection operation on the current write request, so as to write the data carried in the current write request into the second storage device corresponding to the previous write request.
Optionally, the first writing module 603 includes: a storing submodule 6031, configured to store the data write request into a request queue of the second storage device, and store data carried in the data write request into a write buffer of the second storage device; the write-in submodule 6032 is configured to poll the request queue of the second storage device by using a processing thread to obtain the data write request in the request queue of the second storage device, obtain data carried by the data write request from a write buffer of the second storage device according to the size of the data carried by the data write request, and write the data carried by the data write request into a file of the second storage device.
Optionally, after the writing sub-module 6032, the first writing module 603 further includes: a recording sub-module 6033, configured to record metadata of the data write request using the processing thread.
Optionally, the metadata of the data write request includes at least one of: the size of the data carried in the data write request, the offset of the data carried in the data write request in the file to which the data write request belongs, and the physical address of the second storage device, where the recording sub-module 6033 includes: a forming unit 6034, configured to form a new triple by using the size of the data carried in the data write request, the offset of the data carried in the data write request in the file to which the data write request belongs, and the physical address of the second storage device; a determining unit 6035, configured to query a hash table with a file name to which data carried in the data write request belongs as a key, so as to determine whether the key exists in the hash table; a first adding unit 6036, configured to, if the key exists in the hash table, obtain a value corresponding to the key from the hash table, obtain a linked list of the metadata of the file according to the value, and add a value to the tail of the linked list as a new node of the newly-created triple.
Optionally, the recording sub-module 6033 further includes: a second adding unit 6037, configured to create a new linked list if the key does not exist in the hash table, and add a value to the tail of the new linked list as a new node of the newly-created triple; an inserting unit 6038, configured to insert the head pointer of the new linked list into the hash table as a value, and insert the file name to which the data carried in the data write request belongs into the hash table as a key.
The scheduling apparatus of a storage node in this embodiment is used to implement the corresponding scheduling method of a storage node in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again.
Fig. 8 is a schematic structural diagram of an electronic device in a seventh embodiment of the present application; the electronic device may include:
one or more processors 701;
a computer-readable medium 702, which may be configured to store one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the scheduling method of the storage node as described in the first embodiment, the second embodiment, or the third embodiment.
Fig. 9 is a hardware structure of an electronic device according to an eighth embodiment of the present application; as shown in fig. 8, the hardware structure of the electronic device may include: a processor 801, a communication interface 802, a computer-readable medium 803, and a communication bus 804;
wherein the processor 801, the communication interface 802, and the computer readable medium 803 communicate with each other via a communication bus 804;
alternatively, the communication interface 802 may be an interface of a communication module, such as an interface of a GSM module;
the processor 801 may be specifically configured to: when a storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of second storage equipment in the storage node is suitable for the redirection operation of the data write request, wherein the read-write performance of the first storage equipment is superior to that of the second storage equipment; and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the second storage device.
The Processor 801 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The computer-readable medium 803 may be, but is not limited to, a Random Access Memory (RAM), a Read-Only Memory (ROM), a Programmable Read-Only Memory (PROM), an Erasable Read-Only Memory (EPROM), an electrically Erasable Read-Only Memory (EEPROM), and the like.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code configured to perform the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication section, and/or installed from a removable medium. The computer program, when executed by a Central Processing Unit (CPU), performs the above-described functions defined in the method of the present application. It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. The computer readable medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access storage media (RAM), a read-only storage media (ROM), an erasable programmable read-only storage media (EPROM or flash memory), an optical fiber, a portable compact disc read-only storage media (CD-ROM), an optical storage media piece, a magnetic storage media piece, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code configured to carry out operations for the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may operate over any of a variety of networks: including a Local Area Network (LAN) or a Wide Area Network (WAN) -to the user's computer, or alternatively, to an external computer (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions configured to implement the specified logical function(s). In the above embodiments, specific precedence relationships are provided, but these precedence relationships are only exemplary, and in particular implementations, the steps may be fewer, more, or the execution order may be modified. That is, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present application may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a first determination module, a second determination module, and a first write module. For example, the first determining module may be further described as a module that, when the storage node receives a write request and determines that the write request is a data write request of a first storage device in the storage node, acquires the feature data of the data write request and determines whether the feature data meets a configured write request redirection condition.
As another aspect, the present application further provides a computer-readable medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the scheduling method of the storage node as described in the first embodiment, the second embodiment, or the third embodiment.
As another aspect, the present application also provides a computer-readable medium, which may be contained in the apparatus described in the above embodiments; or may be present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: when a storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition; if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of second storage equipment in the storage node is suitable for the redirection operation of the data write request, wherein the read-write performance of the first storage equipment is superior to that of the second storage equipment; and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the second storage device.
The expressions "first", "second", "said first" or "said second" used in various embodiments of the present disclosure may modify various components regardless of order and/or importance, but these expressions do not limit the respective components. The above description is only configured for the purpose of distinguishing elements from other elements. For example, the first user equipment and the second user equipment represent different user equipment, although both are user equipment. For example, a first element could be termed a second element, and, similarly, a second element could be termed a first element, without departing from the scope of the present disclosure.
When an element (e.g., a first element) is referred to as being "operably or communicatively coupled" or "connected" (operably or communicatively) to "another element (e.g., a second element) or" connected "to another element (e.g., a second element), it is understood that the element is directly connected to the other element or the element is indirectly connected to the other element via yet another element (e.g., a third element). In contrast, it is understood that when an element (e.g., a first element) is referred to as being "directly connected" or "directly coupled" to another element (a second element), no element (e.g., a third element) is interposed therebetween.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.

Claims (30)

1. A method of scheduling storage nodes, the method comprising:
when a storage node receives a write request and judges that the write request is a data write request of a first storage device in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition;
if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of second storage equipment in the storage node is suitable for the redirection operation of the data write request, wherein the read-write performance of the first storage equipment is superior to that of the second storage equipment;
and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the second storage device.
2. The method of claim 1, wherein prior to the obtaining the characterization data of the data write request, the method further comprises:
if the length of the obtained request queue of the first storage device exceeds a first preset length, marking the data write request as a redirection request, and determining whether the running state of the second storage device is suitable for the redirection operation of the data write request;
and if the operating state of the second storage device is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the second storage device.
3. The method of claim 1, wherein the feature data comprises at least one of: the size of the data carried by the data writing request, the sender of the data writing request, the file type of the data carried by the data writing request,
before the determining that the characteristic data meets the write request redirection condition, the method further includes:
and if the size of the data carried by the data writing request is determined to exceed a configured threshold, and/or the sender of the data writing request is a set sender, and/or the file type of the data carried by the data writing request is a set file type, determining that the feature data meets the condition of redirecting the writing request.
4. The method of claim 3, wherein when the characterization data includes a size of data carried by the data write request, the method further comprises:
collecting log data of a data writing request received by the storage node in a historical time period, and performing data analysis on the log data to obtain a static threshold value used for comparing the size of the data carried by the data writing request;
if the fact that the number of the data writing requests of the second storage device in the current time period exceeds a preset number and the data volume carried by the data writing requests of the second storage device in the current time period exceeds a preset data volume is detected, increasing the static threshold value according to a preset proportion to obtain a dynamic threshold value used for comparing the size of the data carried by the data writing requests;
and if the fact that the number of the data writing requests of the second storage device in the current time period does not exceed the preset number and the data volume carried by the data writing requests of the second storage device in the current time period does not exceed the preset data volume is detected, reducing the static threshold value according to a preset proportion to obtain a dynamic threshold value used for comparing the size of the data carried by the data writing requests.
5. The method of claim 1, wherein the operational state of the second storage device comprises at least one of: the length of the request queue of the second storage device, the size of data to be written in the write buffer of the second storage device, the utilization rate of the storage space of the second storage device, and the average duration of writing data by the second storage device,
before the determining that the operating state of the second storage device is suitable for the redirection operation of the data write request, the method further includes:
if the result of the determination includes at least one of: the length of the request queue of the second storage device does not exceed a second preset length, the size of data to be written in a write cache region of the second storage device does not exceed a preset threshold, the utilization rate of a storage space of the second storage device does not exceed a preset utilization rate threshold, and the average duration of data written by the second storage device does not exceed a first preset duration, then it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request.
6. The method of claim 1, wherein when the number of the second storage devices for which the running status is appropriate for the redirection operation of the data write request is plural, the method further comprises:
and selecting the second storage equipment used for writing the data carried by the data writing request from the plurality of second storage equipment by adopting a load balancing principle or a load concentration principle.
7. The method of claim 1, wherein the method further comprises:
when the write request received by the storage node is a write log request of the first storage device, caching the write log request into a log file of a write log cache region;
when the write log cache region is full, executing a merging operation on the write log requests in the log files of the write log cache region to obtain a large write log request;
and when the running state of the second storage device is determined to be suitable for the redirection operation of the large write log request, executing the redirection operation on the large write log request so as to write the log data carried by the large write log request into the second storage device.
8. The method of claim 7, wherein after depositing the write log request into a log file of a write log cache, the method further comprises:
and recording the file name of the log file to which the write log request belongs and the offset of the write log request in the log file to which the write log request belongs.
9. The method of claim 1, wherein the method further comprises:
when the write request received by the storage node is a write log request of the first storage device, caching the write log request into a log file of a write log cache region;
polling the state set for the write log cache region by the allocated cache monitoring thread;
and based on the state, executing persistent storage operation on log data carried by the write log request in the log file of the write log cache region.
10. The method of claim 9, wherein polling the allocated cache monitor thread for the status set for the write log cache region further comprises:
if the write log cache region is full and the difference value between the current time point and the time point of the first write log request cached in the write log cache region is less than a second preset time length, using the cache monitoring thread distributed for the write log cache region to update the state of the write log cache region to a preparation state;
and if the difference value between the current time point and the time point of the first write log request cached in the write log cache region is greater than or equal to a second preset time length, updating the state of the write log cache region into a dump state by using the cache monitoring thread distributed for the write log cache region.
11. The method of claim 10, wherein the performing, based on the state, a persistent storage operation on log data carried by the write log request in a log file of the write log cache comprises:
when the state is the preparation state, executing a merging operation on the write log request in the log file of the write log cache region to obtain a large write log request;
and when the running state of the second storage device is determined to be suitable for the redirection operation of the large write log request, executing the redirection operation on the large write log request so as to write the log data carried by the large write log request into the second storage device.
12. The method of claim 11, wherein when the number of the second storage devices whose running state is suitable for redirection operations of the large write log request is plural, the method further comprises:
and selecting the second storage equipment used for writing the log data carried by the large write log request from the plurality of second storage equipment by adopting a load balancing principle or a load centralizing principle.
13. The method of claim 10, wherein the performing, based on the state, a persistent storage operation on log data carried by the write log request in a log file of the write log cache comprises:
when the state is the dump state, executing a merging operation on the write log request in the log file of the write log cache region to obtain a large write log request;
and selecting the first storage equipment used for writing the log data carried by the large write log request from the plurality of first storage equipment by adopting a load balancing principle or a load concentration principle.
14. The method of claim 1, wherein the method further comprises:
when the current write request received by the storage node is a data write request of the first storage device and the last write request received by the storage node is a data write request of the second storage device, acquiring characteristic data of the current write request and determining whether the characteristic data of the current write request meets a configured write request redirection condition;
if the characteristic data is determined not to meet the condition of redirecting the write request, determining whether the size of the data to be written in the write cache region of the second storage device corresponding to the last write request exceeds a configured threshold value;
and if the data to be written in the write cache region of the second storage device corresponding to the last write request is determined not to exceed the configured threshold value, performing redirection operation on the current write request so as to write the data carried by the current write request into the second storage device corresponding to the last write request.
15. The method of claim 1, wherein the performing a redirection operation on the data write request to write data carried by the data write request into the second storage device comprises:
storing the data writing request into a request queue of the second storage device, and storing data carried by the data writing request into a writing buffer area of the second storage device;
and polling the request queue of the second storage device by using a processing thread to acquire the data writing request in the request queue of the second storage device, acquiring data carried by the data writing request from a writing buffer area of the second storage device according to the size of the data carried by the data writing request, and writing the data carried by the data writing request into a file of the second storage device.
16. The method of claim 15, wherein after the writing the data carried by the data write request into the second storage device, the method further comprises:
recording metadata of the data write request using the processing thread.
17. The method of claim 16, wherein the metadata of the data write request comprises at least one of:
the size of the data carried by the data write request, the offset of the data carried by the data write request in the file to which the data write request belongs, and the physical address of the second storage device,
the recording, using the processing thread, metadata of the data write request includes:
forming a new triple group by the size of the data carried by the data writing request, the offset of the data carried by the data writing request in the file to which the data writing request belongs, and the physical address of the second storage device;
taking the file name of the data carried by the data writing request as a key to query a hash table so as to determine whether the key exists in the hash table;
and if the key exists in the hash table, acquiring a value corresponding to the key from the hash table, acquiring a linked list of the metadata of the file according to the value, and adding the value as a new node of the newly-built triple at the tail part of the linked list.
18. The method of claim 17, wherein the method further comprises:
if the key does not exist in the hash table, creating a new linked list, and adding a value to the tail of the new linked list as a new node of the newly-built triple;
and inserting a head pointer of the new linked list into the hash table as a value, and inserting a file name of the data carried by the data writing request into the hash table as a key.
19. An apparatus for scheduling storage nodes, the apparatus comprising:
the first determining module is used for acquiring the characteristic data of a data write request and determining whether the characteristic data meets the configured write request redirection condition or not when the storage node receives the write request and judges that the write request is the data write request of a first storage device in the storage node;
a second determining module, configured to determine whether an operating state of a second storage device in the storage node is suitable for a redirection operation of the data write request if it is determined that the feature data meets the write request redirection condition, where read-write performance of the first storage device is better than read-write performance of the second storage device;
and the first writing module is used for executing redirection operation on the data writing request to write the data carried by the data writing request into the second storage device if the running state of the second storage device is determined to be suitable for the redirection operation of the data writing request.
20. The apparatus of claim 19, wherein the first determining means is preceded by further comprising:
a third determining module, configured to mark the data write request as a redirection request if the obtained length of the request queue of the first storage device exceeds a first preset length, and determine whether the operating state of the second storage device is suitable for a redirection operation of the data write request;
and the second writing module is used for executing redirection operation on the data writing request to write the data carried by the data writing request into the second storage device if the running state of the second storage device is determined to be suitable for the redirection operation of the data writing request.
21. The apparatus of claim 19, wherein the feature data comprises at least one of: the size of the data carried by the data writing request, the sender of the data writing request, the file type of the data carried by the data writing request,
before the second determining module, the apparatus further includes:
a fourth determining module, configured to determine that the feature data meets the write request redirection condition if it is determined that the size of the data carried by the data write request exceeds a configured threshold, and/or the sender of the data write request is a set sender, and/or the file type to which the data carried by the data write request belongs is a set file type.
22. The apparatus of claim 19, wherein the operational state of the second storage device comprises at least one of: the length of the request queue of the second storage device, the size of data to be written in the write buffer of the second storage device, the utilization rate of the storage space of the second storage device, and the average duration of writing data by the second storage device,
before the first writing module, the apparatus further comprises:
a fifth determining module for, if the result of the determination includes at least one of: the length of the request queue of the second storage device does not exceed a second preset length, the size of data to be written in a write cache region of the second storage device does not exceed a preset threshold, the utilization rate of a storage space of the second storage device does not exceed a preset utilization rate threshold, and the average duration of data written by the second storage device does not exceed a first preset duration, then it is determined that the operating state of the second storage device is suitable for the redirection operation of the data write request.
23. The apparatus of claim 19, wherein when the number of the second storage devices for which the running status is suitable for the redirection operation of the data write request is plural, the apparatus further comprises:
and the first selecting module is configured to select, from the plurality of second storage devices, the second storage device for writing the data carried by the data write request by using a load balancing principle or a load concentrating principle.
24. The apparatus of claim 19, wherein the apparatus further comprises:
the first caching module is used for caching the write log request into a log file of a write log cache region when the write request received by the storage node is the write log request of the first storage device;
a merging module, configured to, when the write log cache area is full, perform a merging operation on the write log request in the log file of the write log cache area to obtain a large write log request;
and a third writing module, configured to, when it is determined that the operating state of the second storage device is suitable for the redirection operation of the large write log request, perform a redirection operation on the large write log request, so as to write log data carried by the large write log request into the second storage device.
25. The apparatus of claim 19, wherein the apparatus further comprises:
the second cache module is used for caching the write log request into a log file of a write log cache region when the write request received by the storage node is the write log request of the first storage device;
the polling module is used for polling the state set for the write log cache region by the allocated cache monitoring thread;
and the persistence module is used for executing persistent storage operation on log data carried by the write log request in the log file of the write log cache region based on the state.
26. The apparatus of claim 19, wherein the apparatus further comprises:
a sixth determining module, configured to, when a current write request received by the storage node is a data write request of the first storage device and a last write request received by the storage node is a data write request of the second storage device, obtain feature data of the current write request, and determine whether the feature data of the current write request meets a configured write request redirection condition;
a seventh determining module, configured to determine whether a size of data to be written in a write cache area of the second storage device corresponding to the previous write request exceeds a configured threshold if it is determined that the feature data does not satisfy the write request redirection condition;
and a fourth write-in module, configured to, if it is determined that the size of the data to be written in the write cache area of the second storage device corresponding to the previous write request does not exceed the configured threshold, perform a redirection operation on the current write request, so as to write the data carried in the current write request into the second storage device corresponding to the previous write request.
27. The apparatus of claim 19, wherein the first write module comprises:
the storage submodule is used for storing the data writing request into a request queue of the second storage device and storing data carried by the data writing request into a writing buffer area of the second storage device;
and the writing sub-module is configured to poll the request queue of the second storage device by using a processing thread to obtain the data write request in the request queue of the second storage device, obtain data carried by the data write request from a write buffer of the second storage device according to the size of the data carried by the data write request, and write the data carried by the data write request into a file of the second storage device.
28. A storage node, the storage node comprising:
a scheduler disposed in the storage node,
the scheduler is specifically configured to:
when the storage node receives a write request and judges that the write request is a data write request of a solid state disk in the storage node, acquiring characteristic data of the data write request and determining whether the characteristic data meets a configured write request redirection condition;
if the characteristic data is determined to meet the redirection condition of the write request, determining whether the running state of a disk in the storage node is suitable for the redirection operation of the data write request;
and if the running state of the disk is determined to be suitable for the redirection operation of the data write request, executing the redirection operation on the data write request so as to write the data carried by the data write request into the disk.
29. An electronic device, the device comprising:
one or more processors;
a computer readable medium configured to store one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of scheduling of a storage node of any one of claims 1-18.
30. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method of scheduling of a storage node according to any one of claims 1 to 18.
CN202010080120.2A 2020-02-04 2020-02-04 Storage node scheduling method and device, storage node, equipment and readable medium Pending CN113220212A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010080120.2A CN113220212A (en) 2020-02-04 2020-02-04 Storage node scheduling method and device, storage node, equipment and readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010080120.2A CN113220212A (en) 2020-02-04 2020-02-04 Storage node scheduling method and device, storage node, equipment and readable medium

Publications (1)

Publication Number Publication Date
CN113220212A true CN113220212A (en) 2021-08-06

Family

ID=77085374

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010080120.2A Pending CN113220212A (en) 2020-02-04 2020-02-04 Storage node scheduling method and device, storage node, equipment and readable medium

Country Status (1)

Country Link
CN (1) CN113220212A (en)

Similar Documents

Publication Publication Date Title
US10509739B1 (en) Optimized read IO for mix read/write scenario by chunking write IOs
US20180285167A1 (en) Database management system providing local balancing within individual cluster node
CN109947668B (en) Method and device for storing data
CN103795781B (en) A kind of distributed caching method based on file prediction
US10719245B1 (en) Transactional IO scheduler for storage systems with multiple storage devices
US10776013B2 (en) Performing workload balancing of tracks in storage areas assigned to processing units
CN111324427B (en) Task scheduling method and device based on DSP
US10318346B1 (en) Prioritized scheduling of data store access requests
US9930105B2 (en) Methods, systems, and media for stored content distribution and access
US11914894B2 (en) Using scheduling tags in host compute commands to manage host compute task execution by a storage device in a storage system
US11093399B2 (en) Selecting resources to make available in local queues for processors to use
CN103312624A (en) Message queue service system and method
CN110119304B (en) Interrupt processing method and device and server
US11226778B2 (en) Method, apparatus and computer program product for managing metadata migration
CN115543965A (en) Cross-machine-room data processing method, device, storage medium, and program product
US10592123B1 (en) Policy driven IO scheduler to improve write IO performance in hybrid storage systems
US10606776B2 (en) Adding dummy requests to a submission queue to manage processing queued requests according to priorities of the queued requests
CN112711564B (en) Merging processing method and related equipment
CN110708361B (en) System, method and device for determining grade of digital content publishing user and server
US10812408B1 (en) Preventing concentrated selection of resource hosts for placing resources
CN113220212A (en) Storage node scheduling method and device, storage node, equipment and readable medium
CN111459402A (en) Magnetic disk controllable buffer writing method, controller, hybrid IO scheduling method and scheduler
WO2024021470A1 (en) Cross-region data scheduling method and apparatus, device, and storage medium
US10664170B2 (en) Partial storage of large files in distinct storage systems
CN113835613B (en) File reading method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40056835

Country of ref document: HK