3.1.4.4 Algorithm for Updating the FSVCA Metadata When an Item Changes
The inputs for this algorithm are the following:
SyncGid: The 24-byte SYNC_GID that uniquely identifies an item within the dataset.
IsDelete: A flag that indicates if an item is deleted from the dataset.
The Participant store MUST update the metadata as follows:
Increment the tick count of all the ClockVectorElements associated with the local replica in ClockVectorList.
Search for a FileItemEntry in FileItemList where SyncGid is equal to FileItemEntry.SyncGid. If an entry is found:
Set FileItemEntry.ChangeTickCount to the TickCount associated with the local replica in ClockVectorList.
If IsDelete is TRUE, set FileItemEntry.IsDeleted to TRUE.
Otherwise, create a FileItemEntry and initialize it as follows:
Set FileItemEntry.SyncGid to SyncGid.
Set FileItemEntry.CreateReplicaKey to the index of the local replica in the ReplicaTable.
Set FileItemEntry.CreateTickCount to the TickCount associated with the local replica in ClockVectorList.
Set FileItemEntry.ChangeReplicaKey to the index of the local replica in the ReplicaTable.
Set FileItemEntry.ChangeTickCount to the TickCount associated with the local replica in ClockVectorList.
Set FileItemEntry.IsDeleted to FALSE.
Set WinnerExists to FALSE.
Set WinningFileItem to 0.