-
Notifications
You must be signed in to change notification settings - Fork 4
VVR
It stands for Versioned Volume Repository.
VVR is a volume history, made of devices and snapshots. A VVR can be created, modified and deleted. A VVR enables the creation of 'block devices' accessible by the client. It is also possible to take a snapshot of the device's current state, adding a new version to the VVR history. Additional devices can be created from any snapshot in a copy-on-write mode allowing multiple devices to refer to the same base version.
Whenever a VVR is created, a root snapshot is created.
Example of a VVR tree with 4 snapshots and 3 devices
After a new snapshot is created from the D3 device:
After a new device is created from snapshot S5:
Each VVR is replicated on every node of the VOLD cluster. Modifications to any VVR are synchronized through distributed transactions to the other nodes.
Each device and snapshot is represented by one or more NRS files and the NRS files constitute the hierarchical tree underlying both snapshots and devices. For details on their structure see (NRS).
To be accessible from the outside, a device can be activated read-only (RO) or read-write (RW). An activation will open the corresponding NRS file using the same mode.
- If a node activates the device in RW mode, no other node can activate it.
- If a node activates the device in RO mode, any other node can activate it in RO mode.
- To change from one active mode to the other, the device must first be deactivated.
When a device is activated in RW mode, resized, cloned or when a snapshot is taken, a new NRS file is created. In case of RO activation, no new NRS file is created.
When a client writes to a device:
- The NRS file is updated with the block hash and data are written to the IBS.
- The block hash is replicated on the other nodes.
- The data are sent to the others only if the block was not already present in the IBS.
When a client reads from a device:
- The NRS file is read to get the hash of the block and the IBS is called to retrieve the block.
- If the block is unknown to the IBS, the other nodes are called to get the block from their local IBS; the node where the NRS file was written is queried first.
If a node is stopped for any reasons, it will fall behind the other nodes. When it restarts, its NRS files are updated along the following steps:
- During the synchronization phase, the NRS file tree is updated by the DTX Manager, replaying the missing transactions retrieved from other nodes. All snapshots and devices created while the node was down are updated (for more information, see DTX).
- During the post synchronization phase, the version of each NRS files is checked. If the version is not the last, the contents and the version are updated via the Msg bus without updating data in the IBS.
A coherency mechanism has been implemented to avoid concurrent write operations during update.
-
UniqueVvrObject: This is the parent of all the VVR objects. Each object owns an unique identifier called UUID (see RFC 4122). It is represented by a normalized string. An immutable unique identifier is given to each object. An object can optionally have a name and a description.
-
VvrItem: A VVR item is an element of a VVR hierarchy. This interface describes the common attributes for both devices and snapshots.
-
VersionedVolumeRepository: This is the VVR itself, i.e. a repository containing an arbitrary number of storage volumes and their associated snapshots. All devices and snapshots in a repository derive from a single root snapshot.
-
Snapshot: A snapshot is the image of the volume's contents. Its contents cannot be modified. A snapshot is created from the device's contents at a given time.
-
Devices: A device is the view of the volume's contents and can be read or written. Its size can also be modified. A device is always created from a snapshot.
The implementation of each interface is done using NRS files.
-
AbstractRepositoryImpl: This is the abstract superclass for all VVR implementations.
-
NrsRepository: This is the implementation of the repository interface using NRS files. It keeps reference to all the devices and snapshots.
-
NrsVvrItem: This is the implementation of the VVR item interface using a NRS file.
-
NrsDevice: This is the implementation of the device interface using a NRS file.
-
NrsSnapshot: This is the implementation of the snapshot interface using a NRS file.
Whenever the execution of a request triggers long or complex operations, a task is created. A VvrTask object is exported to follow the progress of a task.
The different task states are:
- PENDING
- STARTED
- PREPARED
- COMMITTED
- ROLLED_BACK
A task has many other attributes, available via VvrTaskInfo objects, e.g. a reference to the result object, the source node of an operation...