Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Versioning & Conflict Management
If multiple User Clients try to modify and put files simultaneously, a version conflict may appear. So in order to detect and avoid such version conflicts, Hive2Hive uses a versioning approach based on Version Keys.
As soon as version-controlled data needs to be put, a version key must be generated for that data item. This version key consists of a timestamp and a hash over the data to be put.
With this mechanism, the storing peer is able to control whether the requested put contains data that is based on the already stored data. For this reason, every user client that tries to put modified data to the DHT has to provide a the new version key.
The following data objects are version-controlled:
Due to Replication, version X of some data object is stored on multiple peers.
- User Client U1 of user U modifies version X.
- U1 puts the new version Y1, which bases on version X, to all replication peers.
- Another user client of the same user U, U2, modifies the version X as well.
- U2 tries to put the new version Y2, which also bases on version X, to all replication peers.
This version conflict is detected because all storing peers check whether the new version key bases on the stored one. If not, they deny the put request. For this reason, U2 cannot put its version Y2 because U1 was faster with putting its version Y1.
Due to Replication, version X of some data object is stored on multiple peers: A, B, C, D and E.
1a. User Client U1 of user U modifies version X
2a. U1 successfully puts its new version Y1 on peers A, B and C.
1b. Another user client of user U, U2, modifies the version X as well.
2b. U2 successfully puts its new version Y2 on peers D and E.
3a. Version Y1 is denied on peers D and E, because there U2 was faster and Y1 does not base on Y2.
3b. Version Y2 is denied on peers A, B and C, because there U1 was faster and Y2 does not base on Y1.