Skip to content

Commit

Permalink
Merge pull request #2493 from cgwalters/summary-lock-shared
Browse files Browse the repository at this point in the history
repo: Change locking for summary regeneration to be shared
  • Loading branch information
cgwalters committed Dec 6, 2021
2 parents 267ca93 + 2c39bd8 commit a07b8d6
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/libostree/ostree-repo.c
Original file line number Diff line number Diff line change
Expand Up @@ -6105,24 +6105,18 @@ summary_add_ref_entry (OstreeRepo *self,
* and refs in %OSTREE_SUMMARY_COLLECTION_MAP are guaranteed to be in
* lexicographic order.
*
* Locking: exclusive
* Locking: shared (Prior to 2021.7, this was exclusive)
*/
gboolean
ostree_repo_regenerate_summary (OstreeRepo *self,
GVariant *additional_metadata,
GCancellable *cancellable,
GError **error)
{
/* Take an exclusive lock. This makes sure the commits and deltas don't get
* deleted while generating the summary. It also means we can be sure refs
* won't be created/updated/deleted during the operation, without having to
* add exclusive locks to those operations which would prevent concurrent
* commits from working.
*/
g_autoptr(OstreeRepoAutoLock) lock = NULL;
gboolean no_deltas_in_summary = FALSE;

lock = ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_EXCLUSIVE,
lock = ostree_repo_auto_lock_push (self, OSTREE_REPO_LOCK_SHARED,
cancellable, error);
if (!lock)
return FALSE;
Expand Down

0 comments on commit a07b8d6

Please sign in to comment.