System and method for event-based synchronization of remote and local file systems
A method for synchronizing a file system (FS) and a remote file system (RFS) includes monitoring the FS for FS events, generating FS event records, receiving RFS event records of RFS events, generating file system operations (FSOs) based on the FS and RFS event records, and communicating the FSOs to the FS and RFS to synchronize them. A method for generating the FSOs includes accessing a plurality of FS and/or RFS event records, processing the accessed records to generate processed event records, generating the FSOs based on the processed event records, and outputting the FSOs to cause synchronization of the FS and RFS. Systems are also described. The invention facilitates event-based, steady-state synchronization of local and remote file systems.
1 . A method for synchronizing a primary file system (PFS) stored on a primary file storage system with a secondary file system (SFS) stored on a secondary file storage system, said method comprising:
providing said PFS including a plurality of data files and primary metadata indicative of a plurality of directories, said primary metadata representing a hierarchical structure of said PFS;
allowing a user to access at least a portion of said primary metadata;
receiving a request to modify said PFS from said user;
responsive to receiving said request to modify said PFS, generating an event record based at least in part on said request to modify; and
utilizing said event record to synchronize said PFS with said SFS.
2 . The method of claim 1 , wherein said step of generating said event record includes creating an entry in an event database, said entry being indicative of said request to modify said PFS.
3 . The method of claim 2 , wherein:
said primary metadata includes information indicative of a particular file system pathway of said PFS;
said request to modify said PFS specifies said particular file system pathway; and
said entry includes said information indicative of said particular file system pathway.
4 . The method of claim 3 , wherein said step of utilizing said event record to synchronize said PFS with said SFS includes generating a file system operation based at least in part on said event record, said file system operation including corresponding information indicative of a corresponding file system pathway of said SFS that is synchronized with said particular file system pathway of said PFS.
5 . The method of claim 4 , wherein said step of generating said file system operation based at least in part on said event record includes copying said information indicative of said particular file system pathway from said event record and saving said information indicative of said particular file system pathway in said file system operation as said corresponding information indicative of said corresponding file system pathway of said SFS.
6 . The method of claim 4 , wherein said file system operation is configured to cause, upon being processed by said secondary file storage system, a corresponding modification to said corresponding file system pathway of said SFS.
7 . The method of claim 3 , wherein:
said request to modify said PFS specifies a particular modification to be made on said particular file system pathway; and
said entry in said event database includes modification information indicative of said particular modification, said modification information being derived from said request to modify said PFS.
8 . The method of claim 7 , wherein said step of utilizing said event record to synchronize said PFS with said SFS includes generating a file system operation based at least in part on said event record, said file system operation including corresponding modification information indicative of a corresponding modification to be made on said corresponding file system pathway of said SFS in order to synchronize said particular file system pathway of said PFS with said corresponding file system pathway of said SFS.
9 . The method of claim 8 , wherein said step of generating said file system operation based at least in part on said event record includes copying said modification information indicative of said particular modification from said event record and saving said modification information indicative of said particular modification in said file system operation as said corresponding modification information indicative of said corresponding modification to be made on said corresponding file system pathway of said SFS.
10 . The method of claim 9 , wherein said file system operation is configured to cause, upon being processed by said secondary file storage system, said corresponding modification to said corresponding file system pathway of said SFS.
11 . The method of claim 8 , wherein:
said particular modification to be made on said particular file system pathway is a metadata modification to be made to at least one record of said primary metadata of said PFS, said at least one record being associated with one of said plurality of directories of said PFS, and said particular file system pathway being indicative of said one of said plurality of directories of said PFS; and
said corresponding modification to be made on said corresponding file system pathway is a corresponding metadata modification to be made to at least one corresponding record of secondary metadata of said SFS, said at least one corresponding record being associated with one of a plurality of corresponding directories of said SFS, and said corresponding file system pathway being indicative of said corresponding one of said plurality of directories of said SFS.
12 . The method of claim 11 , further comprising modifying said at least one record of said primary metadata according to said request to modify.
13 . The method of claim 8 , wherein:
said particular modification to be made on said particular file system pathway is a file modification to be made to one of said plurality of data files of said PFS, said particular file system pathway being indicative of said one of said plurality of directories; and
said corresponding modification to be made on said corresponding file system pathway is a corresponding file modification to be made to a corresponding one of a plurality of data files of said SFS, said corresponding file system pathway being indicative of said corresponding one of said plurality of data files of said SFS.
14 . The method of claim 13 , further comprising:
storing an updated version of said one of said plurality of data files in primary persistent storage of said primary file storage system; and
modifying at least one record of said primary metadata according to said request to modify in order to generate a modified record, said modified record being indicative of said updated version of said one of said plurality of data files on said particular file system pathway; and wherein
said file system operation is configured to cause, upon being processed by said secondary file storage system, said secondary file storage system to pull said updated version of said one of said plurality of data files from said primary file storage system and store said updated version of said one of said plurality of data files in secondary persistent storage of said secondary file storage system; and
said file system operation is configured to cause, upon being processed by said secondary file storage system, said secondary file storage system to modify at least one corresponding record of secondary metadata of said SFS to generate a corresponding modified record, said corresponding modified record being indicative of said updated version of said one of said plurality of data files on said corresponding file system pathway.
15 . The method of claim 3 , further comprising:
generating, responsive to said step of receiving said request to modify said PFS, additional primary metadata, said additional primary metadata including additional information indicative of a second particular file system pathway of said PFS;
generating a second event record based at least in part on said request to modify said PFS; and wherein
said request to modify said PFS also specifies said second particular file system pathway of said PFS; and
said step of generating a second event record includes creating a second entry in said event database, said second entry including said additional information indicative of said second particular file system pathway of said PFS.
16 . The method of claim 15 , wherein:
said entry in said event database includes an event identifier uniquely identifying said event record;
said second entry in said event database includes a second event identifier uniquely identifying said second event record; and further comprising
generating a rename event record associating said event record with said second event record, said rename event record including a third entry in said event database that includes said event identifier and said second event identifier.
17 . The method of claim 16 , wherein:
said request to modify said PFS includes a request to rename a data file of said plurality of data files or a directory of said plurality of directories, said data file or said directory being stored in association with said particular file system pathway;
said step of generating said additional primary metadata includes associating said data file or said directory with said second particular file system pathway; and further comprising
removing prior primary metadata associating said data file or said directory with said particular file system pathway.
18 . The method of claim 17 , further comprising:
utilizing said second event record to synchronize said PFS with said SFS; and wherein
said step of utilizing said event record to synchronize said PFS with said SFS includes generating a file system operation based at least in part on said event record, said file system operation being configured to cause, upon being processed by said secondary file storage system, said secondary file storage system to generate additional secondary metadata associating a corresponding data file of said SFS or a corresponding directory of said SFS with a corresponding second particular file system pathway of said SFS that is synchronized with said second particular file system pathway of said PFS; and
said step of utilizing said second event record to synchronize said PFS with said SFS includes generating a second file system operation based at least in part on said second event record, said second file system operation being configured to cause, upon being processed by said secondary file storage system, said secondary file storage system to remove prior secondary metadata associating said corresponding data file of said SFS or said corresponding directory of said SFS with a corresponding particular file system pathway of said SFS that is synchronized with said particular file system pathway of said PFS.
19 . The method of claim 2 , wherein:
said entry in said event database includes information indicative of a time associated with said request to modify said PFS;
said step of utilizing said event record to synchronize said PFS with said SFS includes processing said event record along with a plurality of other event records to generate a plurality of file system operations to be applied to said SFS;
said plurality of other event records include additional information indicative of a plurality of times each associated with one of a plurality of requests to modify said PFS; and
said step of processing said event record along with said plurality of other event records includes processing said event record and said plurality of other event records in an order based at least in part on said information indicative of said time and said additional information indicative of said plurality of times.
20 . The method of claim 19 , further comprising:
defining a time period having a start time and an end time; and wherein
said time and each time of said plurality of times occurred after said start time and before said end time.