Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document and improve store locking #1438

Merged
merged 23 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8a7f427
Annotate store fields with the assumed concurrency rules
mtrmac Nov 22, 2022
2582470
Fix concurrent accesses to store.graphDriverName
mtrmac Nov 22, 2022
f6914a7
Only use ModifiedSince, not TouchedSince, on store.graphLock
mtrmac Nov 22, 2022
d80b028
Move initialization of store.graphLockLastWrite to store.load
mtrmac Nov 22, 2022
ff41575
Consolidate store.graphLock uses to store.startUsingGraphDriver
mtrmac Nov 22, 2022
36e7ef8
Inline store.getGraphDriver into store.startUsingGraphDriver
mtrmac Nov 22, 2022
1c6ed02
Fix unlocked access to s.graphDriver in LookupAdditionalLayer
mtrmac Nov 22, 2022
b9faefd
Split store.getLayerStoreLocked() from store.getLayerStore()
mtrmac Nov 22, 2022
f68d450
Split store.getROLayerStoresLocked from store.getROLayerStores
mtrmac Nov 22, 2022
489efa7
Split store.allLayerStoresLocked from store.allLayerStores
mtrmac Nov 22, 2022
0b6537d
Add store.bothLayerStoreKinds{,Locked}
mtrmac Nov 22, 2022
ac110ce
Fix locking in store.canUseShifting
mtrmac Nov 22, 2022
57f8caf
Rename the layerStore and roLayerStores fields
mtrmac Nov 22, 2022
f47b948
Remove store.getContainerStore
mtrmac Nov 22, 2022
5f54ee0
Eliminate the parameter to the lambda passed to writeToContainerStore
mtrmac Nov 22, 2022
e9d2b13
Eliminate the parameter to the lambda passed to s.writeToAllStores
mtrmac Nov 22, 2022
a5c8b80
Remove store.getROImageStores
mtrmac Nov 22, 2022
569a11a
Remove store.getImageStore
mtrmac Nov 22, 2022
6aad828
Eliminate the parameter to the lambda passed to s.writeToImageStore
mtrmac Nov 22, 2022
4e9fffb
Eliminate the parameter to the lambda passed to s.writeToAllStores
mtrmac Nov 22, 2022
365d848
Remove the error return value from store.allImageStores
mtrmac Nov 22, 2022
bf13cef
Remove the primaryImageStore parameter of imageTopLayerForMapping
mtrmac Nov 22, 2022
273e81c
Document the locking hierarchy of the various store locks
mtrmac Dec 2, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions layers.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,9 @@ type rwLayerStore interface {

// Clean up unreferenced layers
GarbageCollect() error

// supportsShifting() returns true if the driver.Driver.SupportsShifting().
supportsShifting() bool
}

type layerStore struct {
Expand Down Expand Up @@ -2234,6 +2237,10 @@ func (r *layerStore) LayersByUncompressedDigest(d digest.Digest) ([]Layer, error
return r.layersByDigestMap(r.byuncompressedsum, d)
}

func (r *layerStore) supportsShifting() bool {
return r.driver.SupportsShifting()
}

func closeAll(closes ...func() error) (rErr error) {
for _, f := range closes {
if err := f(); err != nil {
Expand Down
Loading