Method and device for file data and metadata separation for object storage
By storing file data and metadata separately in the object storage system, the problem of reduced metadata management efficiency and cluster stability in the ceph14.2.8 version is solved, achieving more efficient storage and a more stable object storage system.
Patent Information
- Application Number
- PCT/CN2023/143132
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-12
- Filing Date
- 2023-12-29
- Publication Date
- 2024-10-17
AI Technical Summary
In the object storage system, as the number of files increases, the efficiency of metadata management decreases, leading to data balancing and cluster stability problems. Especially in the ceph14.2.8 version of the object storage service, the data balancing rate decreases during expansion, and single resource pool Cluster instability caused by capacity bottlenecks and hardware differences.
By storing file data and metadata separately, and using preset configuration parameters and migration processes, the metadata is migrated from the data data pool to the bucket.index data pool, achieving separate storage of file data and metadata in object storage, and reducing the need for underlying operations, improve storage efficiency, and support horizontal expansion to ease access and storage pressure.
It improves the efficiency of object storage and the stability of the cluster, decouples the coupling relationship between data and metadata, realizes fault isolation of the data cluster, and improves the input and output efficiency of the overall resource pool.
Smart Images

Figure CN2023143132_17102024_PF_FP_ABST
Abstract
Description
Object storage file data and metadata separation storage method and device Technical Field
[0001] The present application relates to the field of object storage technology, and in particular to a method, apparatus, computer equipment, and storage medium for separate storage of object storage file data and metadata. Background Art
[0002] Metadata is data that describes the attributes of data. It is mainly used to support functions such as storage location, historical data, data search, and data logging. Against the backdrop of the rapid development of the Internet (especially mobile Internet), the Internet of Things, cloud computing, and big data, data is growing explosively. The data generated by various applications such as social networks, mobile communications, online video and audio, e-commerce, sensor networks, and scientific experiments not only have huge storage capacity, but also have significant characteristics such as a variety of data types, large changes in data size, and fast flow. They can often generate massive files in the tens of millions, hundreds of millions, or even billions or tens of billions, which poses huge challenges in metadata management. Therefore, file metadata management has become a recognized problem in industry and academia. Based on the object storage service of ceph version 14.2.8, the current storage process has the following two problems with metadata management:
[0003] 1. When the number of files reaches billions, the rate of data balancing decreases significantly during capacity expansion. This is because in Ceph, for user-uploaded files, multiple rados objects (one header object and multiple tail objects) may be generated according to the sharding rules. The file data is sliced and stored on these rados objects. The header object stores the file's xattr metadata. Each rados object corresponds to a file in the Linux file system, and xattr is stored through the file's extended attributes. Since a file uploaded by a user may correspond to multiple Linux files on the backend, as the number of files increases, the efficiency of the xfs file system in listing files decreases, resulting in reduced data balancing efficiency and object storage efficiency.
[0004] 2. Currently, each resource pool of Ceph object storage can only correspond to one data cluster. As the cluster gradually expands, it will bring problems such as single resource pool capacity bottleneck, hardware differences and failure rates leading to cluster stability.
[0005] Therefore, how to improve the efficiency of object storage and the stability of the cluster has become an urgent problem to be solved.
[0006] The present application provides a method, apparatus, computer equipment, and storage medium for separate storage of object storage file data and metadata to improve the efficiency of object storage and the stability of the cluster.
[0007] In a first aspect, the present application provides a method for separate storage of object storage file data and metadata, the method comprising:
[0008] Based on the preset configuration parameters, configure the file attributes and read / write information to obtain the migration configuration information;
[0009] Based on the migration configuration information, the preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separate storage of object storage file data and metadata.
[0010] Furthermore, after executing a preset metadata migration process based on the migration configuration information and migrating the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage to achieve separate storage of object storage file data and metadata, the method further includes:
[0011] When receiving a file to be stored uploaded by a user, determining a target upload type of the file to be stored in normal upload and overwrite upload;
[0012] Determining a target upload process based on the target upload type;
[0013] Based on the target upload process, the file to be stored is uploaded and stored.
[0014] Furthermore, uploading and storing the file to be stored based on the target upload process includes:
[0015] When the target upload type is normal upload, the file to be stored is written into the data pool;
[0016] Metadata is generated based on the file to be stored, and the metadata is stored in the bucket.index data pool to achieve separate storage of object storage file data and metadata.
[0017] Furthermore, uploading and storing the file to be stored based on the target upload process includes:
[0018] When the target upload type is overwrite upload, the file to be stored is written into the data pool;
[0019] Obtain the extended attribute omap of the file to be stored in the bucket.index data pool;
[0020] Based on the extended attribute omap of the file to be stored, the extended attribute omap of the historical file to be stored is overwritten to update the metadata of the file to be stored and realize the separate storage of object storage file data and metadata.
[0021] Furthermore, after uploading and storing the file to be stored based on the target upload process, the method further includes:
[0022] When the target upload type is a normal upload and the file to be stored fails to be uploaded, or the target upload type is an overwrite upload and the file to be stored fails to be uploaded, the file to be stored is sent to a garbage collection queue to wait for recycling;
[0023] When the target upload type is overwrite upload and the to-be-stored file is uploaded successfully, the history header object of the historical storage file corresponding to the to-be-stored file and the historical storage file are added to the garbage collection queue to wait for recycling.
[0024] Furthermore, based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, including:
[0025] When the object to be migrated is a single file object, obtaining an address tag idtag of the object to be migrated based on an identifier of the object to be migrated input by a user;
[0026] Obtaining the location of the metadata based on the idtag, and determining whether the location of the metadata is in the omap based on the migration configuration information;
[0027] When the metadata is not located in the extended attribute omap of the bucket.index data pool, the metadata is written into the extended attribute omap, and a check is performed to determine whether the object to be migrated is deleted.
[0028] When the migration object is not deleted, checking whether the idtag is updated;
[0029] If the idtag is not updated, the location of the metadata is modified to achieve migration of the metadata.
[0030] Furthermore, the method of executing a preset metadata migration process based on the migration configuration information to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage also includes:
[0031] When the object to be migrated is a cluster, reading the migration status of the metadata;
[0032] When the migration status is in progress, obtaining a bucket list to be migrated, and locking the first bucket in the bucket list to be migrated;
[0033] Obtaining bucket information of the first bucket, and obtaining the first bucket metadata migration phase based on the bucket information;
[0034] When the migration is completed in the metadata migration phase and the migration time is not greater than a preset time, the first bucket is unlocked and deleted from the bucket list to be migrated, and all buckets in the bucket list to be migrated are traversed in sequence;
[0035] When the to-be-migrated list is empty, the migration status of the metadata is modified to completed, so as to migrate the metadata of the to-be-migrated object in the data data pool to the bucket.index data pool for storage.
[0036] In a second aspect, the present application further provides a separate storage device for object storage file data and metadata, the device comprising:
[0037] A migration configuration information acquisition module is used to configure the file attributes and read / write information based on preset configuration parameters to obtain migration configuration information;
[0038] The separation storage module is used to execute the preset metadata migration process based on the migration configuration information, and migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separation storage of object storage file data and metadata.
[0039] In a third aspect, the present application also provides a computer device, comprising a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement the above-mentioned method of separate storage of object storage file data and metadata when executing the computer program.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium storing a computer program, which, when executed by a processor, enables the processor to implement the above-mentioned method for separating storage of object storage file data and metadata.
[0041] The present application discloses a method, apparatus, computer equipment and storage medium for separate storage of object storage file data and metadata. Based on preset configuration parameters, the file attributes and read-write information are configured to obtain migration configuration information. Based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, thereby realizing separate storage of object storage file data and metadata. The present application realizes the separate storage of data and metadata, which reduces a large number of underlying operations during the object file upload process, greatly improves the execution efficiency of the program, and improves the efficiency of object storage. On the other hand, it eliminates the coupling relationship between data and metadata, supports horizontal expansion of the data cluster, alleviates the access pressure and storage pressure of a single data cluster, further improves the input and output efficiency of the entire resource pool, realizes fault isolation of the data cluster, and improves the stability of the cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0043] FIG1 is a schematic flow chart of a first embodiment of a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0044] FIG2 is a schematic diagram of object data and metadata distribution before improvement of a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0045] FIG3 is a schematic diagram of object data and metadata distribution after an improvement in a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0046] FIG4 is a flowchart of a single object metadata migration method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0047] 5 is a flowchart of metadata migration of a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0048] FIG6 is a schematic diagram of a metadata separation and upgrade process of a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0049] FIG7 is a schematic flow chart of a second embodiment of a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0050] FIG8 is a flowchart of uploading files to be stored after an improvement in a method for separate storage of object storage file data and metadata provided by an embodiment of the present application;
[0051] FIG9 is a schematic block diagram of a separate storage device for object storage file data and metadata provided by an embodiment of the present application;
[0052] FIG10 is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0054] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.
[0055] It should be understood that the terms used in this specification are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms unless the context clearly indicates otherwise.
[0056] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
[0057] Embodiments of the present application provide a method, apparatus, computer device, and storage medium for separate storage of object-based file data and metadata. This method can be applied to a server, improving object storage efficiency and cluster stability by storing data and metadata separately. The server can be a standalone server or a server cluster.
[0058] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. In the absence of conflict, the following embodiments and features therein may be combined with each other.
[0059] Please refer to Figure 1, which is a schematic flow chart of a method for separate storage of object storage file data and metadata, provided in an embodiment of the present application. This method can be applied to a server to improve object storage efficiency and cluster stability by storing data and metadata separately.
[0060] As shown in FIG1 , the object storage file data and metadata separate storage method specifically includes steps S101 to S102 .
[0061] S101: Based on preset configuration parameters, configure file attributes and read / write information to obtain migration configuration information;
[0062] In one embodiment, Ceph is a unified distributed file system with excellent performance, high availability and scalability. Ceph's unification is reflected in the fact that it can provide file systems, block storage and object storage, and its distribution is reflected in the fact that it can be dynamically expanded. All storage, whether it is block devices, object storage, or file storage, is ultimately converted into the underlying object object. This object contains three elements: data, xattr, and omap. Data is the data of the object, and xattr and omap are both extended attributes of the object. They are stored in Ceph's built-in KV database rocksDB, which is mainly used to list files in the bucket. Due to the characteristics of xattr and omap, single and multiple versions have corresponding version metadata, so xattr can be stored in omap, and the specific version of xattr is stored in the corresponding version, that is, xattr is migrated from the extended attributes of the Linux file system to rocksDB.
[0063] In one embodiment, in order to perform metadata separation on the original cluster without affecting the normal upload and download services of the file, the omap attribute of the file is redesigned. In addition to migrating the xattr attribute to the omap attribute, it is also necessary to add a read and write flag to ensure the normal reading and writing of the file in different upgrade stages. For this purpose, the xattr_pos extended attribute is added, which is used to record the storage location of the file metadata. The default value is 0, where: 0 indicates that the metadata of the object exists in the header object of the Data data pool; 1 indicates that the metadata of the object is located in the omap attribute of the rados object of the Index pool; 2 indicates that the metadata of the object is located both in the header object and in omap.
[0064] In one embodiment, is_complete: a write completion flag exists in the index data structure of omap. This field is used for the operation of updating omap in the double-write process (writing both omap and xattr). It is used to solve the data inconsistency caused by the success of writing the header object and the failure of updating omap in the double-write process, which affects the read result. The default value is true.
[0065] In one embodiment, in order to ensure the metadata separation writing process after the upgrade based on the original cluster, two configuration items are designed, namely rgw_xattrs_write_flag and rgw_xattrs_read_flag.
[0066] Among them, rgw_xattrs_write_flag: the default value is 1, the value of 1 indicates that only the header object is written. If xattr_pos is found to be 1, the object is double-written; the value is 2, indicating that only omap is written; the value is 3, indicating that omap is written first and then the header object; rgw_xattrs_read_flag: the default value is 1, the value of 1 indicates that only the header object is read; the value is 2, indicating that omap is read only; the value is 3, indicating that omap is read first, and the header object is read if it is not found.
[0067] In one embodiment, a migration tool is provided to support migrating the metadata of old objects from the xattr of the head object in the data pool to the omap of the bucket.index pool during the upgrade process. Therefore, the xattrs_pos_status parameter is added to RGWBucketInfo to identify whether the object has been migrated. The specific values and meanings of the parameter are as follows:
[0068] 0: xattr in the head object, not migrated, bucket created by the old cluster, the default value is 0.
[0069] 1:xattr is in the head object or in omap, during migration.
[0070] 2:xattr in omap, a new bucket is created after the migration or upgrade is completed.
[0071] In one embodiment, in order to record the migration status of each object under each bucket in real time, a special namespace xattr_migration is added to the log pool. Only one rados object is created, named: xattrs_migration. Its omapheader records the status of xattr migration and maintains an omap list to record the list of buckets being migrated. The omap_key is bucket_name, and the omap_value is the structure: schedule_migration, which is defined as:
[0072] 0: uninitial, uninitialized, the initial value after the upgrade, means that after the upgrade, no xattr data migration is performed using the command line tool. When the current migration status is this value, the background thread needs to check the migration status regularly;
[0073] 1:processing, during migration, after using the command line tool to migrate xattr data, the migration status changes to this value. When the background thread detects that the migration status is this value, it starts to execute the xattr migration process;
[0074] 2: processed, the migration is completed. When the background thread detects that the migration status is this value, it can exit the thread to save CPU resources;
[0075] In one embodiment, in order not to affect normal business, two configuration items are designed to specify the migration working period and interval, namely: rgw_xattrs_migration_work_time, the working period of the metadata migration thread, the default is 00:00-06:00, and rgw_xattrs_migration_debug_interval, the execution time interval of the metadata migration thread, the default is 10 minutes.
[0076] S102: Based on the migration configuration information, execute a preset metadata migration process to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to achieve separate storage of object storage file data and metadata.
[0077] In one embodiment, as shown in Figure 2, the left side of Figure 2 shows the omap metadata information of files in the index pool. This metadata is stored in the omap of a bucket shard. A bucket shard can store the omap metadata of multiple files, thus forming a one-to-many relationship. The metadata of files in the data pool on the right side is primarily stored in the head object. As can be seen in the right figure, for a multipart uploaded file object obj1, a head object, multiple multipart segment header objects, and multiple shadow segment trailer objects are generated at the bottom layer. The head object only stores the object's xattr metadata information and does not store any data information.
[0078] In one embodiment, based on the metadata storage method described above, if the xattr metadata information stored in the head object of obj1 is migrated to the omap attribute of the corresponding obj1 in the index pool, one less Rados object will be generated at the underlying layer, thus reducing one underlying operation. This reduced number of Rados objects significantly improves storage efficiency in scenarios with massive object storage. The improved object metadata-data distribution is shown in Figure 3.
[0079] Furthermore, based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, and also includes: when the object to be migrated is a cluster, reading the migration status of the metadata; when the migration status is in progress, obtaining a list of buckets to be migrated, and locking the first bucket in the list of buckets to be migrated; obtaining bucket information of the first bucket, and based on the bucket information, obtaining the metadata migration phase of the first bucket; when the migration is completed in the metadata migration phase and the migration time is not greater than a preset time, unlocking the first bucket, deleting the first bucket from the list of buckets to be migrated, and traversing all buckets in the list of buckets to be migrated in turn; when the list to be migrated is empty, modifying the migration status of the metadata to completed, so as to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage.
[0080] In one embodiment, as mentioned above, the migration configuration information includes the working period and interval of data migration, and the data migration work is performed based on the working period and interval.
[0081] In a specific embodiment, the object to be migrated can be the entire cluster. The migration process of the entire cluster is shown in Figure 4. When the cluster metadata starts to migrate, the xattr migration status is read. If the migration status is processing, the bucket list is obtained, the first bucket in the list is locked, and bucketinfo is obtained. When xattrs_pos_status == 2 is not satisfied, the bucket is added to the migration list and the migration progress is read. When xattrs_pos_status == 1, it is determined whether time_now-last_time is greater than 1 hour. If time_now-last_time is less than 1 hour, the bucket is unlocked and deleted from the migration list. The second bucket in the bucket list is obtained and the above operation is performed on the second bucket. All buckets in the bucket list are traversed. After the traversal is completed, it is determined whether the migration list is empty. If the migration list is empty, the xattr migration status is modified to processed.
[0082] In another embodiment, when xattrs_pos_status == 1 is not satisfied, set xattrs_pos_status = 1, and unlock the bucket, obtain 1000 objects according to Starmark, obtain the xattr position of the first object, and determine whether the position is in omap. If not, read xattr from the head object and write it into omap, and modify the position of the xattr data in omap. When all 1000 objects are traversed, record the migration progress of the bucket of the current object and record last_time. When all objects in the bucket are traversed, lock the bucket. When xattrs_pos_status = 2, unlock the bucket, delete the bucket from the migration list, and obtain the second bucket. When all buckets are traversed and the migration list is empty, modify the xattr migration status to processed.
[0083] Furthermore, based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, including: when the object to be migrated is a single file object, based on the identifier of the object to be migrated input by the user, obtaining the address tag idtag of the object to be migrated; obtaining the location of the metadata based on the idtag, and judging whether the location of the metadata is in omap based on the migration configuration information; when the location of the metadata is not in the extended attribute omap of the bucket.index data pool, writing the metadata to the extended attribute omap, and checking whether the object to be migrated is deleted; when the migration object is not deleted, checking whether the idtag is updated; if the idtag is not updated, modifying the location of the metadata to achieve the migration of the metadata.
[0084] In a specific embodiment, the object to be migrated may also be a single file object. The migration process of a single file object is shown in FIG5 . The address tag of the object to be migrated is obtained according to the identifier of the data of the object to be migrated, and the storage location of the metadata is obtained according to the address tag. It is determined whether the storage location of the metadata is in omap. If not, the metadata is obtained and written into omap. After successful writing, the address tag of the metadata is checked to determine whether the address tag is updated. If not, the location information of the metadata is modified to complete the metadata migration.
[0085] In one embodiment, the complete metadata separation upgrade process is shown in Figure 6. CEPH is upgraded to the metadata separation version, single-write and single-read head objects are enabled to maintain consistency with the version before the upgrade, dual-read and dual-write are enabled, grayscale verification of read-write omap is performed, dual-read and single-write omap is enabled, and metadata migration is performed. After the migration of the old data is completed, single-read and single-write omap is enabled. At any of the above stages, if poor stability is found, the read-write configuration items can be modified in time to switch to the original read-write head object process in a timely manner to ensure that the business will resume stable operation in a short period of time.
[0086] Please refer to Figure 7, which is a schematic flow chart of a method for separate storage of object storage file data and metadata, provided in an embodiment of the present application. This method can be applied to a server to improve object storage efficiency and cluster stability by storing data and metadata separately.
[0087] As shown in FIG. 7 , the object storage file data and metadata separate storage method specifically includes steps S201 to S203 .
[0088] S201. Upon receiving a file to be stored uploaded by a user, determining a target upload type of the file to be stored in normal upload and overwrite upload;
[0089] S202: Determine a target upload process based on the target upload type;
[0090] S203: Based on the target upload process, the file to be stored is uploaded and stored.
[0091] Furthermore, based on the target upload process, the file to be stored is uploaded and stored, including: when the target upload type is a normal upload, the file to be stored is written to the data data pool; metadata is generated based on the file to be stored, and the metadata is stored in the bucket.index data pool to realize the separate storage of object storage file data and metadata.
[0092] Furthermore, the target upload process is based on which the file to be stored is uploaded and stored, including: when the target upload type is an overwrite upload, writing the file to be stored into the data data pool; obtaining the extended attribute omap of the file to be stored in the bucket.index data pool; and based on the extended attribute omap of the file to be stored, overwriting the extended attribute omap of the historical file to be stored to update the metadata of the file to be stored and realize the separate storage of object storage file data and metadata.
[0093] Furthermore, after uploading and storing the file to be stored based on the target upload process, it also includes: when the target upload type is normal upload and the upload of the file to be stored fails, or the target upload type is overwrite upload and the upload of the file to be stored fails, the file to be stored is sent to the garbage collection queue to wait for recycling; when the target upload type is overwrite upload and the file to be stored is uploaded successfully, the historical header object of the historical storage file corresponding to the file to be stored and the historical storage file are added to the garbage collection queue to wait for recycling.
[0094] In one embodiment, normal uploading is uploading a new file to be stored, and overwriting uploading is uploading a file that has been uploaded.
[0095] In one embodiment, as shown in FIG8 , for a gateway that has enabled metadata separation configuration, the specific steps for uploading a file to be stored are as follows:
[0096] Step 1: Write the tail object into the data pool;
[0097] Step 2: Get the omap from bucket.index. Since the object being uploaded for the first time does not yet have its omap generated in the bucket.index pool, an omap is generated and written to the index pool, completing the upload process. At this point, the tail object is still stored in the data pool, and the metadata is stored in the index pool. If the upload fails, the tail object is added to the garbage collection queue for recycling.
[0098] In one embodiment, for the overlay upload scenario, the specific process is as follows:
[0099] Step 1: Write the tail object into the data pool;
[0100] Step 2: Get the object's omap from bucket.index. For overwrite uploads, omap must be obtained, and the object's xattr attribute must be present in omap.
[0101] Step 3: Overwrite the omap attribute of the object and update the metadata;
[0102] Step 4: Determine whether the file has been migrated. The metadata separation and upgrade is based on the migration of the old object's metadata. Therefore, the migration must be completed at this point. The head and tail objects of the old object are added to the garbage collection (GC) object. If writing to the omap fails, the tail object is added to the GC for collection. GC stands for garbage collection.
[0103] The above embodiment provides a method for separate storage of object storage file data and metadata, and provides two different processing logics for uploading, downloading and deleting new and old data. While being compatible with old file objects, it can also gradually migrate the xattr metadata of old file objects from the head header object to the omap attribute of the index pool, thereby better providing technical support for subsequent unified metadata cluster services.
[0104] Please refer to Figure 9, which is a schematic block diagram of an embodiment of the present application providing a separate storage device for object-stored file data and metadata. The separate storage device for object-stored file data and metadata is used to perform the aforementioned separate storage method for object-stored file data and metadata. The separate storage device for object-stored file data and metadata can be configured on a server.
[0105] As shown in FIG9 , the object storage file data and metadata separation storage device 300 includes:
[0106] The migration configuration information obtaining module 301 is used to configure the attributes and read / write information of the file based on preset configuration parameters to obtain migration configuration information;
[0107] The separation storage module 302 is used to execute a preset metadata migration process based on the migration configuration information, and migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separation storage of the object storage file data and metadata.
[0108] Furthermore, the object storage file data and metadata separation storage device 300 further includes: a file upload storage module, the file upload storage module including:
[0109] a target upload type determining unit, configured to, upon receiving a file to be stored uploaded by a user, determine a target upload type of the file to be stored in a normal upload and an overwrite upload;
[0110] a target upload process determining unit, configured to determine a target upload process based on the target upload type;
[0111] The file uploading unit is used to upload and store the file to be stored based on the target uploading process.
[0112] Furthermore, the file uploading unit includes:
[0113] The storage file writing subunit is used to write the file to be stored into the data pool when the target upload type is a normal upload;
[0114] The metadata generation subunit is used to generate metadata based on the file to be stored and store the metadata in the bucket.index data pool to achieve separate storage of object storage file data and metadata.
[0115] Furthermore, the file uploading unit includes:
[0116] The storage file writing subunit is used to write the file to be stored into the data pool when the target upload type is overwrite upload;
[0117] The extended attribute omap obtaining subunit is used to obtain the extended attribute omap of the file to be stored in the bucket.index data pool;
[0118] The extended attribute omap overwriting subunit is used to overwrite the extended attribute omap of the historical file to be stored based on the extended attribute omap of the file to be stored, so as to update the metadata of the file to be stored and realize the separate storage of object storage file data and metadata.
[0119] Furthermore, the file upload storage module further includes:
[0120] a waiting recycling unit, configured to send the file to be stored to a garbage collection queue to wait for recycling when the target upload type is a normal upload and the file to be stored fails to be uploaded, or when the target upload type is an overwrite upload and the file to be stored fails to be uploaded;
[0121] The waiting recycling unit is used to add the historical header object of the historical storage file corresponding to the file to be stored and the historical storage file to the garbage collection queue to wait for recycling when the target upload type is overwrite upload and the file to be stored is uploaded successfully.
[0122] Furthermore, the separation storage module 302 includes:
[0123] An address tag idtag acquiring unit, configured to acquire the address tag idtag of the object to be migrated based on an identifier of the object to be migrated input by a user when the object to be migrated is a single file object;
[0124] a location determination unit, configured to obtain the location of the metadata based on the idtag, and determine whether the location of the metadata is in the omap based on the migration configuration information;
[0125] a metadata writing unit, configured to write the metadata into the extended attribute omap of the bucket.index data pool when the metadata is not located therein, and to check whether the object to be migrated is deleted;
[0126] an idtag checking unit, configured to check whether the idtag is updated when the migration object is not deleted;
[0127] A position modification unit is used to modify the position of the metadata if the idtag is not updated, so as to achieve the migration of the metadata.
[0128] Furthermore, the separation storage module 302 further includes:
[0129] A migration status reading unit, configured to read the migration status of metadata when the object to be migrated is a cluster;
[0130] a bucket locking unit, configured to, when the migration state is in progress, obtain a list of buckets to be migrated and lock the first bucket in the list of buckets to be migrated;
[0131] a migration phase acquiring unit, configured to acquire bucket information of the first bucket, and acquire the first bucket metadata migration phase based on the bucket information;
[0132] A bucket unlocking unit is configured to unlock the first bucket when the migration is completed and the migration time is not greater than a preset time in the metadata migration phase, delete the first bucket from the bucket list to be migrated, and traverse all buckets in the bucket list to be migrated in sequence;
[0133] The migration status modification unit is used to modify the migration status of the metadata to completed when the to-be-migrated list is empty, so as to migrate the metadata of the to-be-migrated object in the data data pool to the bucket.index data pool for storage.
[0134] It should be noted that those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0135] The above-mentioned apparatus may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in FIG10 .
[0136] Please refer to Figure 10, which is a schematic block diagram of the structure of a computer device provided by an embodiment of the present application. The computer device may be a server.
[0137] 10 , the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.
[0138] The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, which, when executed, can cause a processor to execute any one of the methods for separating and storing object storage file data and metadata.
[0139] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[0140] The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any object storage file data and metadata separation storage method.
[0141] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that the structure shown in FIG10 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. A specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0142] It should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.
[0143] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:
[0144] Based on the preset configuration parameters, configure the file attributes and read / write information to obtain the migration configuration information;
[0145] Based on the migration configuration information, the preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separate storage of object storage file data and metadata.
[0146] In one embodiment, after executing a preset metadata migration process based on the migration configuration information and migrating the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage to achieve separate storage of object storage file data and metadata, the processor is further configured to:
[0147] When receiving a file to be stored uploaded by a user, determining a target upload type of the file to be stored in normal upload and overwrite upload;
[0148] Determining a target upload process based on the target upload type;
[0149] Based on the target upload process, the file to be stored is uploaded and stored.
[0150] In one embodiment, when determining the target upload process based on the target upload type, the processor is configured to implement:
[0151] When the target upload type is normal upload, the file to be stored is written into the data pool;
[0152] Metadata is generated based on the file to be stored, and the metadata is stored in the bucket.index data pool to achieve separate storage of object storage file data and metadata.
[0153] In one embodiment, when the processor uploads and stores the file to be stored based on the target upload process, it is configured to implement:
[0154] When the target upload type is overwrite upload, the file to be stored is written into the data pool;
[0155] Obtain the extended attribute omap of the file to be stored in the bucket.index data pool;
[0156] Based on the extended attribute omap of the file to be stored, the extended attribute omap of the historical file to be stored is overwritten to update the metadata of the file to be stored and realize the separate storage of object storage file data and metadata.
[0157] In one embodiment, after implementing the target upload process and uploading and storing the file to be stored, the processor is further configured to implement:
[0158] When the target upload type is a normal upload and the file to be stored fails to be uploaded, or the target upload type is an overwrite upload and the file to be stored fails to be uploaded, the file to be stored is sent to a garbage collection queue to wait for recycling;
[0159] When the target upload type is overwrite upload and the to-be-stored file is uploaded successfully, the history header object of the historical storage file corresponding to the to-be-stored file and the historical storage file are added to the garbage collection queue to wait for recycling.
[0160] In one embodiment, when executing a preset metadata migration process based on the migration configuration information and migrating the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, the processor is configured to implement:
[0161] When the object to be migrated is a single file object, obtaining an address tag idtag of the object to be migrated based on an identifier of the object to be migrated input by a user;
[0162] Obtaining the location of the metadata based on the idtag, and determining whether the location of the metadata is in the omap based on the migration configuration information;
[0163] When the metadata is not located in the extended attribute omap of the bucket.index data pool, the metadata is written into the extended attribute omap, and a check is performed to determine whether the object to be migrated is deleted.
[0164] When the migration object is not deleted, checking whether the idtag is updated;
[0165] If the idtag is not updated, the location of the metadata is modified to achieve migration of the metadata.
[0166] In one embodiment, when executing a preset metadata migration process based on the migration configuration information and migrating the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, the processor is further configured to implement:
[0167] When the object to be migrated is a cluster, reading the migration status of the metadata;
[0168] When the migration status is in progress, obtaining a bucket list to be migrated, and locking the first bucket in the bucket list to be migrated;
[0169] Obtaining bucket information of the first bucket, and obtaining the first bucket metadata migration phase based on the bucket information;
[0170] When the migration is completed in the metadata migration phase and the migration time is not greater than a preset time, the first bucket is unlocked and deleted from the bucket list to be migrated, and all buckets in the bucket list to be migrated are traversed in sequence;
[0171] When the to-be-migrated list is empty, the migration status of the metadata is modified to completed, so as to migrate the metadata of the to-be-migrated object in the data data pool to the bucket.index data pool for storage.
[0172] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and the computer program includes program instructions. The processor executes the program instructions to implement any object storage file data and metadata separation storage method provided in the embodiment of the present application.
[0173] The computer-readable storage medium may be an internal storage unit of the computer device described in the aforementioned embodiment, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the computer device.
[0174] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present application, and such modifications or substitutions should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A method for separating storage of object storage file data and metadata, It is characterized in that include: Based on the preset configuration parameters, configure the file attributes and read / write information to obtain migration configuration information; Based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separate storage of object storage file data and metadata.
2. The method for storing object storage file data and metadata separately according to claim 1, It is characterized in that Based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separation storage of the object storage file data and the metadata, and further includes: When receiving a file to be stored uploaded by a user, determining a target upload type of the file to be stored in normal upload and overwrite upload; Based on the target upload type, determining a target upload process; Based on the target upload process, the file to be stored is uploaded and stored.
3. The method for storing object storage file data and metadata separately according to claim 2, It is characterized in that Based on the target upload process, uploading and storing the file to be stored includes: When the target upload type is a normal upload, the file to be stored is written into the data pool; Metadata is generated based on the file to be stored, and the metadata is stored in the bucket.index data pool to achieve separate storage of object storage file data and metadata.
4. The method for storing object storage file data and metadata separately according to claim 2, It is characterized in that Based on the target upload process, uploading and storing the file to be stored includes: When the target upload type is overwrite upload, the file to be stored is written into the data pool; Obtain the extended attribute omap of the file to be stored in the bucket.index data pool; Based on the extended attribute omap of the file to be stored, the extended attribute omap of the historical file to be stored is overwritten to update the metadata of the file to be stored and realize the separate storage of object storage file data and metadata.
5. The method for separating and storing object storage file data and metadata according to claim 2, It is characterized in that Based on the target upload process, after uploading and storing the file to be stored, the process further includes: When the target upload type is a normal upload and the file to be stored fails to be uploaded, or the target upload type is an overwrite upload and the file to be stored fails to be uploaded, the file to be stored is sent to a garbage collection queue to wait for recycling; When the target upload type is overwrite upload and the to-be-stored file is uploaded successfully, the history header object of the historical storage file corresponding to the to-be-stored file and the historical storage file are added to the garbage collection queue to wait for recycling.
6. The method for separate storage of object storage file data and metadata according to claim 1, It is characterized in that Based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, including: When the object to be migrated is a single file object, based on the identifier of the object to be migrated input by the user, obtaining the address tag idtag of the object to be migrated; Acquire the location of the metadata based on the idtag, and determine whether the location of the metadata is in omap based on the migration configuration information; When the location of the metadata is not in the extended attribute omap of the bucket.index data pool, the metadata is written into the extended attribute omap, and it is checked whether the object to be migrated is deleted; When the migration object is not deleted, checking whether the idtag is updated; If the idtag is not updated, the location of the metadata is modified to achieve migration of the metadata.
7. The method for separate storage of object storage file data and metadata according to any one of claims 1 to 6, It is characterized in that Based on the migration configuration information, a preset metadata migration process is executed to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, and further includes: When the object to be migrated is a cluster, reading the migration status of the metadata; When the migration status is in progress, obtaining a bucket list to be migrated, and locking the first bucket in the bucket list to be migrated; Obtaining bucket information of the first bucket, and obtaining the first bucket metadata migration phase based on the bucket information; When the migration is completed and the migration time is not greater than the preset time in the metadata migration stage, the first bucket is unlocked, and the first bucket is deleted from the bucket list to be migrated, and all buckets in the bucket list to be migrated are traversed in sequence; When the list to be migrated is empty, the migration status of the metadata is modified to be completed, so as to migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage.
8. A separate storage device for object storage file data and metadata, It is characterized in that include: A migration configuration information acquisition module is used to configure the attributes and read-write information of the file based on preset configuration parameters to obtain migration configuration information; The separation storage module is used to execute the preset metadata migration process based on the migration configuration information, and migrate the metadata of the object to be migrated in the data data pool to the bucket.index data pool for storage, so as to realize the separation storage of object storage file data and metadata.
9. A computer device, It is characterized in that The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the following when executing the computer program: A method for separately storing object storage file data and metadata as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the method for separate storage of object storage file data and metadata according to any one of claims 1 to 7.
Citation Information
Patent Citations
Storage method and device for distributed object storage metadata and storage medium
CN112346659A
Data migration method based on object storage and server
CN114064563A
Data migration method and device, equipment and medium
CN115061630A
Metadata storage method and device based on distributed key value database
CN115454994A
Data processing method, processor, device, system and storage medium
CN115576921A
Cited By
Data synchronization method and device, computer equipment and storage medium
CN119415602A
Data storage method, medium, electronic equipment and program product
CN119937921A
Data fragment management method and system and computing equipment
CN120780758A
Cross-cloud data migration method and device and storage medium
CN120856666A
