Updating a remote tree for a client synchronization service
The disclosed technology relates to a system configured to receive operations data from a content management system, wherein the operations data comprises a log of operations, execute the log of operations, and update, based on execution of the log of operations, a remote tree representing a server state for content items stored on the content management system.
1. A computer-implemented method comprising:
receiving operations data from a content management system, wherein the operations data comprises a log of operations;
comparing a remote tree representing a server state of content items stored on the content management system to the log of the operations to determine a subset of the log of the operations to be applied to bring the remote tree up to date;
executing the subset of the log of the operations;
updating, based on execution of the log of the operations, the remote tree;
determining that the updated remote tree and a sync tree are out of sync, the sync tree representing a difference between the server state associated with the remote tree and a file system state associated with a local tree, the local tree representing the file system state for the content items stored on a client device; and
generating, based on a difference between the updated remote tree and the sync tree, a set of operations that perform converging of the server state associated with the remote tree and the file system state associated with the local tree.
2. The computer-implemented method of claim 1 , further comprising transmitting a cursor to the content management system, wherein the log of the operations is based on the cursor.
3. The computer-implemented method of claim 1 , wherein the operations data comprises linearized operations across a plurality of namespaces.
4. The computer-implemented method of claim 1 , wherein the operations data comprises revisions data for a namespace of a plurality of namespaces.
5. The computer-implemented method of claim 1 , further comprising managing the execution of the set of operations.
6. The computer-implemented method of claim 1 , wherein the remote tree and the sync tree are stored at the client device.
7. The computer-implemented method of claim 1 , further comprising:
receiving, from the content management system, a mount notification for mounting a target namespace within an existing namespace represented in the remote tree;
receiving, from the content management system, an initial portion of a log of operations for the target namespace;
building a subtree for the target namespace based on the initial portion of the log of the operations received from the content management system; and
mounting the subtree for the target namespace at a mount location of the remote tree.
8. The computer-implemented method of claim 7 , wherein the initial portion of the log of the operations is bounded by a start of the log of the operations to a cursor value for a mount operation detected by the content management system.
9. The computer-implemented method of claim 7 , wherein the subtree for the target namespace is mounted after the initial portion of the log of the operations is processed to build the subtree.
10. The computer-implemented method of claim 7 , further comprising:
receiving, from the content management system, a mount operation for the target namespace, wherein the mount operation is associated with the existing namespace and specifies the mount location in the existing namespace; and
wherein the target namespace is mounted at the mount location in response to the mount operation.
11. A non-transitory computer readable medium comprising instructions, the instructions, when executed by a computing system, cause the computing system to:
receive operations data from a content management system, wherein the operations data comprises a log of operations;
compare a remote tree representing a server state of content items stored on the content management system to the log of the operations to determine a subset of the log of the operations to be applied to bring the remote tree up to date;
execute the subset of the log of the operations;
update, based on execution of the log of the operations, the remote tree;
determine that the updated remote tree and a sync tree are out of sync, the sync tree representing a difference between the server state associated with the remote tree and a file system state associated with a local tree, the local tree representing the file system state for the content items stored on a client device; and
generate, based on a difference between the updated remote tree and the sync tree, a set of operations that perform converging of the server state associated with the remote tree and the file system state associated with the local tree.
12. The non-transitory computer readable medium of claim 11 , wherein the instructions further cause the computing system to transmit a cursor to the content management system, wherein the log of the operations is based on the cursor.
13. The non-transitory computer readable medium of claim 11 , wherein the operations data comprises linearized operations across a plurality of namespaces.
14. The non-transitory computer readable medium of claim 11 , wherein the operations data comprises revisions data for a namespace of a plurality of namespaces.
15. The non-transitory computer readable medium of claim 11 , wherein the instructions further cause the computing system to manage the execution of the set of operations.
16. A system comprising:
a processor; and
a non-transitory computer-readable medium storing instructions that, when executed by the processor, cause the processor to:
receive operations data from a content management system, wherein the operations data comprises a log of operations;
compare a remote tree representing a server state of content items stored on the content management system to the log of the operations to determine a subset of the log of the operations to be applied to bring the remote tree up to date;
execute the subset of the log of the operations;
update, based on execution of the log of the operations, the remote tree;
determine that the updated remote tree and a sync tree are out of sync, the sync tree representing a difference between the server state associated with the remote tree and a file system state associated with a local tree, the local tree representing the file system state for the content items stored on a client device; and
generate, based on a difference between the updated remote tree and the sync tree, a set of operations that perform converging of the server state associated with the remote tree and the file system state associated with the local tree.
17. The system of claim 16 , wherein the instructions further cause the processor to transmit a cursor to the content management system, wherein the log of the operations is based on the cursor.
18. The system of claim 16 , wherein the operations data comprises linearized operations across a plurality of namespaces.
19. The system of claim 16 , wherein the operations data comprises revisions data for a namespace of a plurality of namespaces.
20. The system of claim 16 , wherein the instructions further cause the processor to manage the execution of the set of operations.