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 processor;
- and
- a memory communicatively coupled to the processor and storing instructions that, when executed, cause the resource repository system to perform operations comprising:
- receiving a request for a transaction on a resource of a repository;
- creating a snapshot of the repository, wherein a hard link associates the snapshot with the resource;
- performing reads and/or writes of the transaction against the snapshot;
- evaluating potential conflicts between the reads and/or the writes of the transaction and those of other concurrently committed transactions, wherein evaluating the potential conflicts comprises determining whether the resource of the repository is changed;
- responsive to no conflict being found, committing the transaction to a write-ahead log, wherein committing the transaction to the write-ahead log comprises:
- creating a new copy of the resource having one or more modifications associated with the transaction;
- replacing the hard link associating the snapshot with the resource with a new hard link associating the snapshot to the new copy of the resource;
- and
- logging the transaction to the write-ahead log;
- and
- updating the repository to include the one or more modifications to the resource based on 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;
- creating a snapshot of the repository, wherein a hard link associates the snapshot with the resource;
- performing reads and/or writes of the transaction against the snapshot;
- evaluating potential conflicts between the reads and/or the writes of the transaction and those of other concurrently committed transactions, wherein evaluating the potential conflicts comprises determining whether the resource of the repository is changed;
- responsive to no conflict being found, committing the transaction to a write-ahead log, wherein committing the transaction to the write-ahead log comprises:
- creating a new copy of the resource having one or more modifications associated with the transaction;
- replacing the hard link associating the snapshot with the resource with a new hard link associating the snapshot to the new copy of the resource;
- and
- logging the transaction to the write-ahead log;
- and
- updating the repository to include the one or more modifications to the resource based on 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:
- creating a snapshot of a repository, wherein a hard link associates the snapshot with a resource;
- performing reads and/or writes of a transaction involving the resource against the snapshot;
- evaluating potential conflicts between the reads and/or the writes of the transaction and those of other concurrently committed transactions, wherein evaluating the potential conflicts comprises determining whether the resource of the repository is changed;
- responsive to no conflict being found, committing the transaction to a write-ahead log, wherein committing the transaction to the write-ahead log comprises:
- creating a new copy of the resource having one or more modifications associated with the transaction;
- replacing the hard link associating the snapshot with the resource with a new hard link associating the snapshot to the new copy of the resource;
- and
- logging the transaction to the write-ahead log;
- and
- updating the repository to include the one or more modifications to the resource based on the write-ahead log.
Dependencies are inferred from the claim text.