PERSISTENT STORAGE DEVICE MANAGEMENT
A method includes receiving a request to write data at a virtual location, writing the data to a physical location on a persistent storage device, and recording a mapping from the virtual location to the physical location. The physical location corresponds to a next free block in a sequence of blocks on the persistent storage device.
1 . A method comprising:
receiving a first request to write first data at a first virtual location;
writing the first data to a first physical location on a persistent storage system;
recording a first mapping from the first virtual location to the first physical location;
receiving a second request to write second data at the first virtual location;
writing the second data to a second physical location on the persistent storage system indicated by a head pointer, the second physical location being different from the first physical location, wherein each block on the persistent storage system is written to once, before any block of the persistent storage system is written to a second time; and
replacing the first mapping with a second mapping from the first virtual location to the second physical location.
2 . The method of claim 1 , wherein the first virtual location and the first physical location are not correlated with one another.
3 . The method of claim 1 , wherein the first physical location is determined by a head counter.
4 . The method of claim 3 , further comprising after writing the data to the first physical location, updating the head counter.
5 . The method of claim 1 , wherein writing the second data to the second physical location occurs without performing a read from the first physical location.
6 . The method of claim 1 , further comprising:
calculating a checksum for the first data; and
recording the checksum in metadata associated with the persistent storage system.
7 . A system comprising:
one or more processors; and
a memory;
wherein the memory comprises instructions which, when executed by the one or more processors, configure the one or more processors to perform the method of claim 1 .
8 . One or more non-transitory computer readable media comprising instructions which, when executed by one or more processors, cause the one or more processors to perform the method of claim 1 .
9 . A method comprising writing a plurality of stripes i=0 . . . N to a plurality of drives 0 M−1, wherein each stripe i includes a plurality of data blocks and at least one parity block, and wherein a starting data block of stripe i is written to drive i modulo M.
10 . The method of claim 9 , wherein a parity block of stripe i is written to a first one of the drives and a parity block of stripe i+1 is written to a second one of the drives different than the first one of the drives.
11 . The method of claim 9 , wherein the plurality of drives comprises a plurality of persistent storage devices.
12 . The method of claim 9 , wherein stripe i includes the data or parity blocks at physical location i on drives 0 . . . M−1.
13 . A system comprising:
one or more processors; and
a memory;
wherein the memory comprises instructions which, when executed by the one or more processors, configure the one or more processors to perform the method of claim 9 .
14 . One or more non-transitory computer readable media comprising instructions which, when executed by one or more processors, cause the one or more processors to perform the method of claim 9 .
15 . A method comprising:
writing a plurality of stripes i=0 . . . N to a plurality of drives 0 . . . M−1, wherein each stripe includes a plurality of data blocks and at least one parity block, and wherein a starting data block of stripe i is written to drive i modulo M;
marking one or more data blocks in the plurality of stripes as dirty, wherein a tail counter identifies a first physical location on a first one of the drives that stores an oldest non-dirty data block, and wherein a head counter identifies a second physical location on a second one of the drives with a next free block;
identifying, on the first drive, a first data block stored at the first physical location indicated by the tail pointer;
storing, on the second drive, the first data block at the second physical location indicated by the head pointer; and
marking the first physical location on the first drive storing the first data block as dirty.
16 . The method of claim 15 , further comprising following the storing of the first data block on the second drive, updating a mapping so that a virtual location which previously mapped to the first physical location on the first drive now maps to the second physical location on the second drive.
17 . The method of claim 15 , further comprising following the storing of the first data block on the second drive, storing, on the second drive, a parity block at the second physical location indicated by the head pointer.
18 . The method of claim 15 , wherein a parity block of stripe i is written to a first one of the drives and a parity block of stripe i+1 is written to a second one of the drives different than the first one of the drives.
19 . A system comprising:
one or more processors; and
a memory;
wherein the memory comprises instructions which, when executed by the one or more processors, configure the one or more processors to perform the method of claim 15 .
20 . One or more non-transitory computer readable media comprising instructions which, when executed by one or more processors, cause the one or more processors to perform the method of claim 15 .