Transactional access to resource repositories
AssigneeGitLab Inc.
InventorSami Hiltunen
Life of this patent
Estimating the term…
Abstract
Resources, like source code, can be stored in a repository and managed through a resource repository system. The resource repository system includes a processor and a memory for storing a plurality of data structures, each data structure comprising a current version of a corresponding resource and at least one past version of the corresponding resource. The processor is communicatively coupled to the memory and configured to: request a transaction on a resource of a repository; create a snapshot of the repository; perform reads and/or writes of the transaction against the snapshot; evaluate potential conflicts between concurrently committed transactions; if no conflict is found, commit the transaction by persisting it to a write-ahead log; and update the repository based on the write-ahead log.
Claims20
A resource repository system comprising:
- a memory for storing a plurality of data structures, each data structure comprising a current version of a corresponding resource and at least one past version of the corresponding resource;
- and
- a processor communicatively coupled to the memory and configured to:
- receive a request for a transaction on a resource of a repository, the transaction making one or more changes to the resource of the repository;
- create a snapshot of the repository by:
- copying a directory structure of the repository into a temporary directory and hard linking resources of the repository to the temporary directory;
- or
- using a copy-on-write functionality of a filesystem to create a clone of the repository into a temporary directory;
- perform reads and/or writes of the transaction on the snapshot;
- evaluate potential conflicts between the reads and/or the writes of the transaction and those of other concurrently committed transactions;
- responsive to no conflict being found, commit the transaction to a write-ahead log;
- and
- update the repository based on the changes recorded in the write-ahead log.
A method for performing a transaction on a resource on a database, the method comprising:
- receiving a request for a transaction on a resource of a repository, the transaction making one or more changes to the resource of the repository;
- creating a snapshot of the repository by:
- copying a directory structure of the repository into a temporary directory and hard linking resources of the repository to the temporary directory;
- or
- using a copy-on-write functionality of a filesystem to create a clone of the repository into a temporary directory;
- performing reads and/or writes of the transaction on the snapshot;
- evaluating potential conflicts between the reads and/or the writes of the transaction and those of other concurrently committed transactions;
- responsive to no conflict being found, committing the transaction to a write-ahead log;
- and
- updating the repository based on the changes recorded in the write-ahead log.
A computer program product comprising a non-transitory computer readable storage medium having instructions encoded thereon that, when executed by a computing system, cause the computing system to perform operations including:
- receiving a request for a transaction on a resource of a repository, the transaction making one or more changes to the resource of the repository;
- creating a snapshot of the repository by:
- copying a directory structure of the repository into a temporary directory and hard linking resources of the repository to the temporary directory;
- or
- using a copy-on-write functionality of a filesystem to create a clone of the repository into a temporary directory;
- performing reads and/or writes of the transaction on the snapshot;
- evaluating potential conflicts between the reads and/or the writes of the transaction and those of other concurrently committed transactions;
- responsive to no conflict being found, committing the transaction to a write-ahead log;
- and
- updating the repository based on the changes recorded in the write-ahead log.
Dependencies are inferred from the claim text.