Exception handling method and device, electronic equipment, storage medium and computer program product
By recording the first information when data writing fails in the storage system and asynchronously deleting the data that has been successfully written based on this information, the slow response speed, data loss and management complexity when data writing fails is solved, and the stability and reliability of the storage system are improved.
Patent Information
- Application Number
- CN202510024939.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, when data writing fails in storage systems, the response speed is slow, the data is lost in large quantities, or the complexity of data management and data residues are increased.
In the case where the data is failed to be written to the storage system, the first information is recorded, indicating that the second data has been successfully written, and the second data is deleted asynchronously based on this information.
It avoids process blocking and slow response speed when directly deleting data, reduces data residues, improves the accuracy of data deletion, increases the stability and reliability of the storage system, and reduces management complexity.
Smart Images

Figure CN120045552A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data technology, and in particular, to an exception handling method, apparatus, electronic device, storage medium, and computer program product. Background Art
[0002] Currently, the existing methods for handling the situation of data write failure in a storage system have problems such as slow response speed of the storage system, large amount of data loss, or increased complexity of data management and increased data residue. Summary of the Invention
[0003] To solve the related technical problems, embodiments of this application provide an exception handling method, apparatus, electronic device, storage medium, and computer program product.
[0004] The technical solution of the embodiments of this application is implemented as follows:
[0005] Embodiments of this application provide an exception handling method, including:
[0006] When the write of the first data to the storage system fails, record the first information, where the first information indicates the second data in the first data that has been successfully written to the storage system;
[0007] Based on the first information, delete the second data from the storage system.
[0008] In the above solution, the first information at least includes the identifier of the second data, and based on the first information, deleting the second data from the storage system includes:
[0009] Based on the identifier of the second data, asynchronously delete the second data from the storage system.
[0010] In the above solution, the first information further includes one or more of the following of the second data:
[0011] Number of occupied bytes;
[0012] Write timestamp;
[0013] Check value.
[0014] In the above solution, the method further includes:
[0015] When one or more of the following are satisfied, determine that the write of the first data to the storage system fails:
[0016] The total number of data slices and parity slices included in the second data is less than the total number of data slices in the first data, and the parity slices are obtained from the data slices;
[0017] The number of data copies included in the second data is less than the total number of copies of the first data.
[0018] In the above solution, the data table or database in the storage system that stores the second data is different from the data table or database that stores the first information.
[0019] In the above solution, the method further includes:
[0020] Receiving a first request for requesting to write the first data to the storage system;
[0021] Fragmenting the first data to obtain a plurality of data slices of the first data;
[0022] Calculating one or more check slices of the first data based on the plurality of data slices of the first data;
[0023] Writing the data slices and check slices of the first data to the storage system.
[0024] An embodiment of the present application further provides an exception handling device, including:
[0025] A recording unit, configured to record first information indicating second data in the first data that has been successfully written to the storage system when writing the first data to the storage system fails;
[0026] A deleting unit, configured to delete the second data from the storage system based on the first information.
[0027] An embodiment of the present application further provides an electronic device, including a processor and a memory for storing a computer program that can run on the processor,
[0028] wherein, when the processor is used to run the computer program, it executes the steps of any of the above methods.
[0029] An embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, it implements the steps of any of the above methods.
[0030] An embodiment of the present application further provides a computer program product, including a computer program, and when the computer program is executed by a processor, it implements the steps of any of the above methods.
[0031] In the exception handling method, apparatus, electronic device, storage medium, and computer program product provided by the embodiments of the present application, when writing the first data to the storage system fails, first information is recorded, and the first information indicates second data that has been successfully written to the storage system in the first data; based on the first information, the second data is deleted from the storage system. In the above solution, when the data writing fails, the first information is recorded, and the second data is deleted based on the first information, avoiding process blocking and slow response speed of the storage system caused by the inability to successfully delete the second data when directly deleting the second data from the storage system. At the same time, while reducing data residue, it can prevent a large amount of data loss caused by accidental deletion, improve the accuracy of data deletion, increase the stability and reliability of the storage system, and reduce the complexity of storage system management. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a flowchart of an exception handling method according to an embodiment of the present application;
[0033] Figure 2 It is a flowchart of an exception handling method according to an application embodiment of the present application;
[0034] Figure 3 It is an example diagram of data slices and parity slices of first data according to an application embodiment of the present application;
[0035] Figure 4 It is a schematic structural diagram of an exception handling apparatus according to an embodiment of the present application;
[0036] Figure 5 It is a schematic structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] In the related art, data writing in a storage system may fail for various reasons, such as hardware failures, software errors, or network failures. In the case of data writing failure, if corresponding measures are not taken in time, it may further lead to data loss or corruption. A common measure to deal with data writing failure is to directly delete the data with writing failure. Since the reason for data writing failure is usually an abnormality in the data cluster, directly deleting the written shard or replica at this time will still cause data writing failure, and synchronous deletion will block the processing process and reduce performance. The problem of data writing failure can also be addressed by asynchronous deletion. Asynchronous deletion can improve the system response speed when data writing fails, but there is also a problem that it cannot be determined whether the shard or replica has been truly deleted, which may result in the data with writing failure still being stored in the storage system, causing data residue. The reason for the writing failure of the storage pool may be that the high load causes data writing failure, that is, when a large number of requests fail and retry is selected, it will increase the pressure on the storage pool, leading to a cyclic deterioration of system performance, and more request timeouts are caused due to request accumulation, ultimately resulting in a large amount of data residue.
[0038] It can be seen that although the method of directly deleting the data with writing failure is simple and easy to implement, it will slow down the system response speed when data writing fails. If there is a large amount of data with writing failure, it will also cause a large amount of data loss; although the asynchronous deletion method can improve the system response speed when data writing fails, asynchronous writing failure will cause the failed data to still be stored in the storage system, resulting in data residue, and increasing the complexity of data management.
[0039] Based on this, in various embodiments of the present application, in the case of writing the first data to the storage system fails, record the first information, where the first information indicates the second data that has been successfully written to the storage system in the first data; based on the first information, delete the second data from the storage system. In the above solution, in the case of data writing failure, record the first information and delete the second data based on the first information, avoiding the process blockage and the slowdown of the storage system response speed caused by the inability to successfully delete the second data when directly deleting the second data from the storage system. It can also reduce data residue while preventing a large amount of data loss caused by misdeletion, improve the accuracy of data deletion, increase the stability and reliability of the storage system, and reduce the complexity of storage system management.
[0040] The following further describes the present application in detail with reference to the drawings and embodiments.
[0041] The embodiment of the present application provides an exception handling method, which is applied to an electronic device. The electronic device can be understood as a device or a storage gateway that runs or deploys a storage system. The storage system may include one or more storage pools. As Figure 1 shown, the method includes:
[0042] Step 101: When the writing of the first data to the storage system fails, record the first information.
[0043] Wherein, the first information indicates the second data in the first data that has been successfully written to the storage system.
[0044] Here, the electronic device can, when receiving a data writing request, write the original data carried in the data writing request to the storage system; or when receiving a data writing request, process the original data carried in the data writing request and write the processed original data to the storage system, where the processing includes data slicing and / or redundancy processing, and the redundancy processing includes erasure coding and / or multi-copy mode; during the data writing process, data writing may fail due to hardware failures, software errors, or network failures. At this time, there are situations where part of the data is successfully written and the other part fails, and all of the data fails to be written. For the situation where part of the data is successfully written and the other part fails, the successfully written data needs to be deleted to improve the stability and reliability of the storage system and reduce the complexity of storage system management. Based on this, when the writing of the first data to the storage system fails, record the first information to accurately delete the second data. The data writing methods include distributed writing and asynchronous writing; among them, distributed writing is to divide the data to be written to the storage system into multiple stripes or shards and write the divided data stripes or data shards to the storage system.
[0045] The first data can be understood as the original data carried in the data write request. When a data write request is received, redundant processing can be performed on the first data. Writing the first data to the storage system can be understood as writing the processed first data to the storage system. The processed first data can include one or more of multiple data slices of the first data, one or more parity slices, and multiple data replicas. Correspondingly, the second data can include one or more of one or more data slices of the first data, one or more parity slices, and one or more data replicas. The specific content included in the processed first data is determined according to the redundant processing method used, and the specific content included in the second data is determined according to the content actually written to the storage system in the first data. For example, when using the erasure code mechanism as the redundant processing method, the processed first data can include multiple data slices of the first data and one or more parity slices. Correspondingly, the second data can include one or more data slices of the first data and / or one or more parity slices. When using the multi-copy mode as the redundant processing method, the processed first data can include multiple data replicas. Correspondingly, the second data can include one or more data replicas. When using both the erasure code mechanism and the multi-copy mode as the redundant processing method, the first data can include multiple data slices of the first data, one or more parity slices, and multiple data replicas. Correspondingly, the second data can include one or more of one or more data slices of the first data, one or more parity slices, and one or more data replicas.
[0046] When using the erasure code mechanism as the redundant processing method for the first data, if writing the first data to the storage system fails, it can be understood that writing the data slices and parity slices of the first data to the storage system fails. When using the multi-copy mode as the redundant processing method for the first data, if writing the first data to the storage system fails, it can be understood that writing the replica data of the first data to the storage system fails.
[0047] The first data can also be understood as the processed original data, that is, the first data includes one or more of multiple data slices of the original data, one or more parity slices, and multiple data replicas. The specific content included in the first data is determined according to the redundant processing method used.
[0048] In order to improve the performance of the storage system, in one embodiment, the data table or database storing the second data in the storage system is different from the data table or database storing the first information.
[0049] Here, the data table or database in the storage system that stores the second data can be understood as the data table or database in the storage system where the first data is written, that is, the data table or database in the storage system that executes the normal business process. The data table or database in the storage system that stores the second data is different from the data table or database that stores the first information. It can be understood that the first information and the second data are stored separately, that is, the first information and the data stored in the normal business process are stored separately. The first information can be stored in an independent data table or database in the storage system to avoid competing for resources with the normal business process and causing performance hotspots.
[0050] In order to improve the reliability and availability of data in the storage system, in one embodiment, the method further includes:
[0051] Receiving a first request for requesting to write the first data into the storage system;
[0052] Fragmenting the first data to obtain multiple data slices of the first data;
[0053] Calculating one or more parity slices of the first data based on the multiple data slices of the first data;
[0054] Writing the data slices and parity slices of the first data into the storage system.
[0055] Here, the first request may carry the first data, and the first data can be understood as the original data. In the case of receiving the first request, the first data can be redundantly processed according to the erasure code mechanism; using the erasure code mechanism needs to satisfy the k+m rule. k represents the number of data slices of the original data, and its value range depends on the actual capacity and storage requirements of the storage system. m represents the number of parity slices of the original data, and its value range depends on the design and requirements of the storage system. The specific values of k and m can be determined according to actual needs, such as 6+3 or 20+16, etc. Specifically, fragmenting the first data to obtain the data slices of the first data, that is, obtaining k data slices, and then calculating one or more parity slices of the first data based on the k data slices of the first data, that is, calculating m parity slices of the first data, and writing the k data slices and m parity slices of the first data into the storage system; for example, multiplying the k data slices as a vector by a generator matrix (GT, GeneratorMatrix) to obtain a codeword vector, which is composed of k data slices and m parity slices, so as to obtain the parity slices of the first data. In the case where there are data slices and / or parity slices lost among the k data slices and m parity slices, the lost data slices and / or parity slices can be recovered by multiplying the codeword vector by the inverse matrix of GT. The erasure code mechanism can tolerate at most m data slices and / or parity slices being lost, thereby improving the reliability and availability of data in the storage system.
[0056] It should be noted that when the first request is received, the first data can also be redundantly processed in a multi-copy mode. Specifically, multiple data copies are generated based on the first data, and the generated data copies are written to the storage system. For example, three data copies can be generated.
[0057] In order to accurately determine the failure of data writing and thus take corresponding measures for the failure of data writing to ensure the integrity and reliability of the data, in one embodiment, the method further includes:
[0058] When one or more of the following conditions are met, it is determined that the writing of the first data to the storage system fails:
[0059] The total number of data slices and parity slices included in the second data is less than the total number of data slices in the first data, and the parity slices are obtained from the data slices.
[0060] The number of data copies included in the second data is less than the total number of copies of the first data.
[0061] Here, when the first data uses the erasure code mechanism as the redundancy processing method, the electronic device slices the first data, calculates one or more parity slices of the first data based on multiple data slices of the first data. Writing the first data to the storage system can be understood as writing multiple data slices and parity slices of the first data to the storage system. In the erasure code mechanism, all data slices and parity slices of the first data can be obtained from any k data slices and / or parity slices of the first data (that is, the total number of data slices and parity slices of the first data is k). That is, when the erasure code mechanism is used as the redundancy processing method, it is determined that at least k data slices and / or parity slices of the first data need to be written for the first data writing to succeed. Based on this, when the total number of data slices and parity slices (data slices and parity slices included in the second data) that have been successfully written to the storage system in the first data is less than the total number of all data slices in the first data, the electronic device cannot obtain all data slices and parity slices of the first data based on the data slices and parity slices included in the second data, and it is determined that the writing of the first data to the storage system fails, and the data slices and parity slices that have been successfully written to the storage system in the first data need to be deleted; and / or,
[0062] When the first data adopts a multi-copy mode as a redundancy processing method, the electronic device generates multiple data copies based on the first data and writes the multiple data copies to the storage system, so that in the case where a node storing a data copy in the storage system fails, the first data can still be obtained from other nodes storing the data copies, improving the availability and fault tolerance of the system. That is, when adopting the multi-copy mode as the redundancy processing method, it is necessary to write all the data copies of the first data into the storage system to determine that the writing of the first data is successful; based on this, when the number of data copies of the first data that have been successfully written into the storage system (the data copies included in the second data) is less than the total number of copies of the first data, it is determined that the writing of the first data to the storage system fails, and it is necessary to delete the data copies of the first data that have been successfully written into the storage system.
[0063] In a storage system with a storage capacity reaching a certain level (such as a PB (Petabyte)-level storage system), the reasons for data write failure can include: First, disk failure or network exception, resulting in frequent abnormal situations in the storage pool, so that data cannot be successfully written into the storage pool in the storage system when writing data to the storage system; Second, the electronic device may also fail to write data to the storage pool due to high load when receiving a data write request; Third, the storage pool will frequently perform consistency checks, occupying a large amount of resources, resulting in a decrease in the processing capacity of the storage system and thus causing the write request to fail. In this embodiment, it is possible to handle the situation of data write failure without determining the specific reason for data write failure, thereby improving the stability and reliability of the storage system.
[0064] Step 102: Delete the second data from the storage system based on the first information.
[0065] Here, based on the first information, the storage location of the second data can be found. The second data can include one or more data slices, one or more parity slices, and one or more data copies of the first data that have been successfully written into the storage system, and the second data is deleted from the storage system to release the storage space of the second data.
[0066] In order to improve the response speed of the storage system when data write fails and reduce the performance loss of the storage system, in one embodiment, the first information at least includes the identifier of the second data, and the deleting the second data from the storage system based on the first information includes:
[0067] Asynchronously delete the second data from the storage system based on the identifier of the second data.
[0068] Here, after recording the first information, a deletion task can be started, the first information can be read to obtain the identifier of the second data, the storage location of the second data can be found in the storage system based on the identifier of the second data, and the second data can be deleted from the storage system. Specifically, the deletion task can be set to start regularly and can be started by a task scheduling system, that is, the task scheduling system in the electronic device can regularly clean the data that fails to be written in the storage system. The identifier of the second data includes one or more of the identifiers of the data slices of the first data that have been successfully written into the storage system, the identifiers of one or more check slices, and the identifiers of one or more data copies. The identifier can uniquely indicate a data slice, a check slice, or a data copy. The identifier of the second data can be represented as an index.
[0069] In this embodiment, the second data is asynchronously deleted by restarting the task, which does not occupy the processing process of normal services, avoids process blocking, and improves the response speed of the storage system when data writing fails.
[0070] In order to improve the accuracy of deleting the second data, in one embodiment, the first information further includes one or more of the following of the second data:
[0071] The number of bytes occupied;
[0072] The write timestamp;
[0073] The check value.
[0074] Here, when the first information includes the number of bytes occupied, it can be determined whether the second data has been completely deleted from the storage system by comparing the number of bytes occupied by the second data with the size of the storage space released by the storage system after deleting the second data. When the first information includes the write timestamp, the second data can be further determined by comparing the write timestamp of the second data with the timestamp when the data writing fails, improving the accuracy of the determined second data. When the first information includes the check value, when deleting the second data, the check value of the second data to be deleted can be recalculated and compared with the check value of the corresponding second data in the first information, thus avoiding misdeletion. The check value can be a Message-Digest Algorithm 5 (MD5) value.
[0075] The following further describes the present application in detail with application examples.
[0076] As Figure 2 shown, the exception handling method is applied to an electronic device and includes the following steps:
[0077] Step 201: Receive a first request.
[0078] Here, the first request can be understood as a data write request, carrying the first data; the first data is redundantly processed to obtain data slices and parity slices of the first data, and / or data copies of the first data. For example, the first data can be redundantly processed in a Reed-Solomon code multi-copy mode to obtain multiple data slices and parity slices of the first data. As shown in Figure 3 Figure 1, slices 1 to 9 are data slices and parity slices of the first data, where slices 1 to 6 are data slices of the first data, and slices 7 to 9 are parity slices of the first data, and each slice corresponds to an identifier one by one.
[0079] Step 202: Write the first data to the storage system.
[0080] Here, the first data can be written to the storage system in a distributed write manner or in an asynchronous write manner; in the case where the electronic device uses a Reed-Solomon code redundancy processing method for the original data, the data slices and parity slices of the first data can be written to the storage system; in the case where the electronic device uses a multi-copy mode redundancy processing method for the original data, the data copies of the first data can be written to the storage system. For example, as shown in Figure 3 Figure 2, writing the data slices and parity slices of the first data to the storage system means writing slices 1 to 9 to the storage system.
[0081] Step 203: Determine whether writing the first data to the storage system is successful.
[0082] Here, in the case of using Reed-Solomon code for redundant processing of the original data, the total number of data slices and parity slices included in the second data is compared with the total number of data slices in the first data; in the case where the total number of data slices and parity slices included in the second data is less than the total number of data slices in the first data, it is determined that writing the first data to the storage system fails, and step 204 is executed; in the case where the total number of data slices and parity slices included in the second data is greater than or equal to the total number of data slices in the first data, it is determined that writing the first data to the storage system is successful, and step 206 is executed. For example, as shown in Figure 3 Figure 3, slices 5 to 8 are all written fails, that is, they are not written to the storage system. The data slices and parity slices of the first data that have been successfully written to the storage system include slices 1 to 4 and slice 9, that is, the total number of data slices and parity slices that have been successfully written to the storage system is 5, Figure 3 and the total number of data slices in the first data is 6. That is to say, the total number of data slices and parity slices included in the second data is less than the total number of data slices in the first data, and it is determined that writing the first data to the storage system fails.
[0083] In the case of redundant processing of the original data using the erasure code multi-copy mode, compare the number of data copies included in the second data with the total number of copies of the first data; in the case where the number of data copies included in the second data is less than the total number of copies of the first data, determine that the write of the first data to the storage system fails, and execute step 204; in the case where the number of data copies included in the second data is greater than or equal to the total number of copies of the first data, determine that the write of the first data to the storage system is successful, and execute step 206.
[0084] Step 204: Record the first information.
[0085] Here, a first request may include multiple write shard requests and / or multiple write copy requests. Even if the first request fails (the write of the first data fails), there may be a situation where some data slices, parity slices, and / or data copies of the first data are written successfully. It is necessary to accurately delete the successfully written data slices, parity slices, and / or data copies to improve the availability and reliability of the storage system. Based on this, in the case where the write of the first data to the first storage system fails, it is necessary to record the first information. The first information can be a separate data table in the storage system or a separate database used. For example, Figure 3 the write of the first data to the storage system fails. Among them, the write of data slices 5 to 8 of the first data to the storage system fails, and the write of data slices 1 to 4 and data slice 9 of the first data to the storage system is successful. Record the identifiers of data slices 1 to 4 and data slice 9, and one or more of the number of bytes occupied by data slices 1 to 4 and data slice 9, the write timestamp, and the check value can also be recorded as the first information, and store the first information into a separate data table or database.
[0086] Step 205: Based on the first information, delete the second data from the storage system.
[0087] Here, a deletion task can be started, the first information can be read, and based on the first information, the second data in the storage system can be asynchronously deleted to avoid affecting the normal business process and improve the response speed of the storage system when the data write fails. The deletion task can be set to start regularly, so as to avoid immediately retrying after the data write fails, which increases the load of the storage system and causes more request timeouts due to request aggregation, so as to reduce the performance loss of the storage system. Specifically, based on the identifier of the second data included in the first information, the second data can be deleted from the storage system. For example, as Figure 3 shown, based on the identifiers of data slices 1 to 4 and data slice 9 included in the first information, the second data can be deleted from the storage system, so as to be able to completely delete the successfully written data from the storage system and avoid data residue.
[0088] Step 206: End.
[0089] Here, when the writing of the first data into the storage system is successful, the metadata of the first data can also be stored in the storage system, and / or, a result indicating successful data writing can be returned to the sender of the first request.
[0090] To implement the method of the embodiments of the present application, the embodiments of the present application further provide an exception handling device, as Figure 4 shown, the device includes:
[0091] A recording unit 401, configured to record first information indicating second data that has been successfully written into the storage system in the first data when the writing of the first data into the storage system fails;
[0092] A deleting unit 402, configured to delete the second data from the storage system based on the first information.
[0093] In an embodiment, the first information at least includes an identifier of the second data, and the deleting unit 402 is specifically configured to asynchronously delete the second data from the storage system based on the identifier of the second data.
[0094] In an embodiment, the first information further includes one or more of the following of the second data:
[0095] The number of bytes occupied;
[0096] The write timestamp;
[0097] The check value.
[0098] In an embodiment, the device further includes:
[0099] A determining unit, configured to determine that the writing of the first data into the storage system fails when one or more of the following are satisfied:
[0100] The total number of data slices and parity slices included in the second data is less than the total number of data slices in the first data, and the parity slices are obtained from the data slices;
[0101] The number of data copies included in the second data is less than the total number of copies of the first data.
[0102] In an embodiment, the data table or database in the storage system storing the second data is different from the data table or database storing the first information.
[0103] In an embodiment, the device further includes:
[0104] A receiving unit, configured to receive a first request for requesting to write the first data into the storage system;
[0105] A slicing unit, configured to slice the first data to obtain a plurality of data slices of the first data;
[0106] A calculating unit, configured to calculate one or more check slices of the first data based on the plurality of data slices of the first data;
[0107] A writing unit, configured to write the data slices and check slices of the first data into the storage system.
[0108] In practical applications, the recording unit 401, the deleting unit 402, the determining unit, the receiving unit, the slicing unit, the calculating unit, and the writing unit may be implemented by a processor in an exception handling device.
[0109] It should be noted that: when the above-mentioned exception handling device performs exception handling, only the division of the above-mentioned program modules is used as an example. In practical applications, the above-mentioned processing may be allocated to different program modules according to needs, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the exception handling device provided in the above-mentioned embodiment and the embodiment of the exception handling method belong to the same concept. For the specific implementation process, please refer to the method embodiment, which will not be elaborated here.
[0110] Based on the hardware implementation of the above program modules, an embodiment of the present application further provides an electronic device, as Figure 5 shown, the electronic device 500 includes:
[0111] A communication interface 501, which can perform information interaction with other devices or network nodes.
[0112] A processor 502, connected to the communication interface 501 to implement information interaction with other devices or network nodes, and is used to execute the method provided by one or more technical solutions in the above-mentioned embodiment when running a computer program.
[0113] A memory 503, configured to store a computer program that can run on the processor 502.
[0114] Specifically, the processor 502 is configured to record first information indicating second data that has been successfully written into the storage system in the first data when the writing of the first data into the storage system fails;
[0115] Based on the first information, delete the second data from the storage system.
[0116] In one embodiment, the first information at least includes an identifier of the second data, and the processor 502 is specifically configured to asynchronously delete the second data from the storage system based on the identifier of the second data.
[0117] In one embodiment, the first information further includes one or more of the following of the second data:
[0118] Number of bytes occupied;
[0119] Write timestamp;
[0120] Check value.
[0121] In one embodiment, the processor 502 is further configured to determine that writing the first data to the storage system fails when one or more of the following are satisfied:
[0122] The total number of data slices and parity slices included in the second data is less than the total number of data slices in the first data, and the parity slices are obtained from the data slices;
[0123] The number of data copies included in the second data is less than the total number of copies of the first data.
[0124] In one embodiment, the data table or database storing the second data in the storage system is different from the data table or database storing the first information.
[0125] In one embodiment, the communication interface 501 is configured to receive a first request for requesting to write the first data to the storage system;
[0126] In one embodiment, the processor 502 is further configured to fragment the first data to obtain multiple data slices of the first data;
[0127] Calculate one or more parity slices of the first data based on the multiple data slices of the first data;
[0128] Write the data slices and parity slices of the first data to the storage system.
[0129] It should be noted that: The specific processing process of the processor 502 can be understood with reference to the above method.
[0130] Of course, in actual application, each component in the electronic device 500 is coupled together through the bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between these components. The bus system 504 includes not only a data bus, but also a power bus, a control bus, and a status signal bus. However, for the sake of clear illustration, in Figure 5 all kinds of buses are labeled as the bus system 504.
[0131] The memory 503 in the embodiments of the present application is used to store various types of data to support the operation of the electronic device 500. Examples of such data include: any computer program for operating on the electronic device 500.
[0132] The methods disclosed in the embodiments of the present application described above can be applied to or implemented by the processor 502. The processor 502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, the steps of the above methods can be completed by the integrated logic circuit in the hardware of the processor 502 or instructions in the form of software. The above-mentioned processor 502 may be a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 502 can implement or execute the various methods, steps, and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. Combining the steps of the methods disclosed in the embodiments of the present application, it can be directly embodied as being executed and completed by the hardware decoding processor, or executed and completed by the combination of the hardware and software modules in the decoding processor. The software module may be located in the storage medium, which is located in the memory 503. The processor 502 reads the information in the memory 503 and combines its hardware to complete the steps of the foregoing methods.
[0133] In an exemplary embodiment, the electronic device 500 may be implemented by one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontroller units (MCUs), microprocessors, or other electronic components for executing the foregoing methods.
[0134] It can be understood that the memory (memory 503) in the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-Only Memory), an electrically erasable programmable read-only memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), a ferromagnetic random access memory (FRAM, Ferromagnetic Random Access Memory), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM, Random Access Memory), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as a static random access memory (SRAM, Static Random Access Memory), a synchronous static random access memory (SSRAM, Synchronous Static Random Access Memory), a dynamic random access memory (DRAM, Dynamic Random Access Memory), a synchronous dynamic random access memory (SDRAM, Synchronous Dynamic Random Access Memory), a double data rate synchronous dynamic random access memory (DDR SDRAM, Double Date Rate Synchronous Dynamic Random Access Memory), an enhanced synchronous dynamic random access memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), a synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and a direct rambus random access memory (DRRAM, Direct Rambus Random Access Memory).The memories described in the embodiments of the present application are intended to include, but are not limited to, these and any other suitable types of memories.
[0135] In an exemplary embodiment, the embodiments of the present application further provide a storage medium, namely a computer storage medium, specifically a computer-readable storage medium. For example, it includes a memory 503 storing a computer program, and the above computer program can be executed by a processor 502 of an electronic device 500 to complete the steps described in any of the foregoing methods. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disc, or CD-ROM.
[0136] Exemplarily, the embodiments of the present application further provide a computer program product, including a computer program, and the computer program can be executed by a processor 502 of an electronic device 500 to complete the steps described in any of the foregoing methods.
[0137] It should be noted that "first", "second", etc. are used to distinguish similar objects and do not necessarily need to describe a specific order or sequence. The term "and / or" in this article is merely a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, both A and B exist simultaneously, and B exists alone. In addition, the technical solutions described in the embodiments of the present application can be arbitrarily combined without conflict. The above is only a preferred embodiment of the present application and is not used to limit the protection scope of the present application.
Claims
1. An exception handling method, characterized in that: include: In the case of failure in writing the first data to the storage system, recording first information indicating that the second data in the first data has been successfully written into the storage system; Based on the first information, the second data is deleted from the storage system.
2. The method according to claim 1, characterized in that The first information includes at least an identifier of the second data, and deleting the second data from the storage system based on the first information includes: Based on the identifier of the second data, the second data is asynchronously deleted from the storage system.
3. The method according to claim 2, characterized in that The first information also includes one or more of the following items of the second data: The number of bytes occupied; The timestamp of the write; Check value.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: When one or more of the following conditions are met, it is determined that writing the first data to the storage system fails: The total number of data slices and check slices included in the second data is less than the total number of data slices in the first data, and the check slices are obtained based on the data slices; The number of data copies included in the second data is less than the total number of copies of the first data.
5. The method according to claim 1, characterized in that The data table or database storing the second data in the storage system is different from the data table or database storing the first information.
6. The method according to claim 1, characterized in that The method further comprises: receiving a first request, where the first request is used to request writing the first data to the storage system; Slice the first data to obtain multiple data slices of the first data; Calculate one or more check pieces of the first data based on the multiple data pieces of the first data; Write a data slice and a check slice of the first data to the storage system.
7. An exception handling device, characterized in that: include: a recording unit, configured to record first information indicating that second data in the first data has been successfully written into the storage system when writing the first data into the storage system fails; A deleting unit is used to delete the second data from the storage system based on the first information.
8. An electronic device, characterized in that: comprising a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 6.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 6 when executed by a processor.