主权项 |
1. A method of synchronizing filesystem changes, comprising:
sorting, in a canonical order, a list of directory elements wherein each directory element includes a canonical representation of metadata associated with a node in the filesystem; determining a chunk of directory elements comprising one or more consecutive directory elements by breaking up the sorted list of directory elements sorted in a canonical order; computing at a client system a hash of data comprising the chunk of directory elements sorted in canonical order; determining based at least in part on the computed hash whether the corresponding directory elements as stored on the remote server are identical to the directory elements comprising the chunk as stored on the client system, wherein the determining whether the corresponding directory elements as stored on the remote server are identical to the directory elements comprising the chunk as stored on the client system comprises determining whether the computed hash is previously stored in a hash cache on the client system; and in the event that the computed cache was not previously stored in the hash cache,
sending, to the remote server, the computed hash and information from which the remote server computes a verification hash, wherein the computed hash is compared to the verification hash to determine whether the corresponding directly elements as stored on the remote server are identical to the directory elements comprising the chunk as stored on the client system; andsending the one or more directory elements comprising the chunk to a remote server in the event it is determined based at least in part on the computed hash that corresponding directory elements as stored on the remote server are not identical to the directory elements comprising the chunk as stored on the client system, wherein at least a portion of the one or more directory elements comprising the chunk that are sent to the remote server correspond to at least a subset of changes in data stored at the client system since a previous synchronization between the remote server and the client system. |