Method and system for improving rebuild for a storage system
A method is used in improving rebuilding in data storage. The generation number of a PLB is compared with a generation number of a partition corresponding to the PLB. The data of the PLB is rebuilt based on the comparison.
1. A method for improving rebuild in a storage system, the method comprising: comparing a generation number of a physical layer block (PLB) with a generation number of a partition 5 corresponding to the PLB; and rebuilding data in the PLB based on the comparison.
2. The method of claim 1 , wherein rebuilding data in the PLB based on the comparison comprises:
rebuilding data in the PLB when the generation number of the PLB is equal to a generation number of the partition corresponding to the PLB.
3. The method of claim 1 , further comprising:
receiving a write request pertaining to the PLB when a storage device corresponding to the PLB is unavailable;
obtaining the generation number of the partition corresponding to the PLB; and
setting the generation number of the PLB to the generation number of the partition corresponding to the PLB.
4. The method of claim 3 , further comprising:
storing the generation number of the PLB to a PLB descriptor.
5. The method of claim 3 , further comprising:
setting an indicator that data in the PLB is invalid.
6. The method of claim 3 , wherein comparing the generation number of the PLB with the generation number of the partition corresponding to the PLB comprises:
comparing the generation number of the PLB stored in the PLB descriptor to the generation number of the partition.
7. The method of claim 1 , further comprising:
completing a rebuild cycle of the partition corresponding to the PLB; and
incrementing the generation number of the partition.
8. A system for improving rebuild in a storage system, the system including a processor configured to: compare a generation number of a physical layer block (PLB) with a generation number of a partition corresponding to the PLB; and rebuild data in the PLB based on the comparison.
9. The system of claim 8 , wherein the processor is further configured to:
rebuild data in the PLB when the generation number of the PLB is equal to a generation number of the partition corresponding to the PLB.
10. The system of claim 8 , wherein the processor is further configured to:
receive a write request pertaining to the PLB when a storage device corresponding to the PLB is unavailable;
obtain the generation number of the partition corresponding to the PLB; and
set the generation number of the PLB to the generation number of the partition corresponding to the PLB.
11. The system of claim 10 , wherein the processor is further configured to:
store the generation number of the PLB to a PLB descriptor.
12. The system of claim 10 , wherein the processor is further configured to:
set an indicator that data in the PLB is invalid.
13. The system of claim 10 , wherein the processor is further configured to:
compare the generation number of the PLB stored in the PLB descriptor to the generation number of the partition.
14. The system of claim 8 , wherein the processor is further configured to:
completing a rebuild cycle of the partition corresponding to the PLB; and
incrementing the generation number of the partition.