Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Clearing cache on a volume doesn't clear the source #770

Closed
MikaelSmith opened this issue Apr 14, 2020 · 0 comments · Fixed by #773
Closed

Clearing cache on a volume doesn't clear the source #770

MikaelSmith opened this issue Apr 14, 2020 · 0 comments · Fixed by #773
Labels
bug Something isn't working

Comments

@MikaelSmith
Copy link
Contributor

Setup is to run a Docker container and use Wash to navigate to some point in its filesystem. Depending on where you are, running wclear . doesn't actually clear cached data. whistory output is the clearest way to demonstrate that.

wash docker/containers/strange_fermat/fs/usr/local > wclear .
wash docker/containers/strange_fermat/fs/usr/local > whistory 1
Apr 14 16:24:36.627 API: DELETE /cache?path=%2FUsers%2Fmichaelsmith%2FLibrary%2FCaches%2Fwash%2Fmnt167843624%2Fdocker%2Fcontainers%2Fstrange_fermat%2Ffs%2Fusr%2Flocal
Apr 14 16:24:36.627 API: Cache DELETE /docker/containers/strange_fermat/fs/usr/local []
Apr 14 16:24:36.627 API: DELETE /cache?path=%2FUsers%2Fmichaelsmith%2FLibrary%2FCaches%2Fwash%2Fmnt167843624%2Fdocker%2Fcontainers%2Fstrange_fermat%2Ffs%2Fusr%2Flocal complete

The 2nd line of output shows nothing was deleted from the cache.

wash docker/containers/strange_fermat/fs/usr/local > wclear ..
wash docker/containers/strange_fermat/fs/usr/local > whistory 2
Apr 14 16:24:48.079 API: DELETE /cache?path=%2FUsers%2Fmichaelsmith%2FLibrary%2FCaches%2Fwash%2Fmnt167843624%2Fdocker%2Fcontainers%2Fstrange_fermat%2Ffs%2Fusr
Apr 14 16:24:48.079 API: Cache DELETE /docker/containers/strange_fermat/fs/usr [List::/docker/containers/strange_fermat/fs]
Apr 14 16:24:48.079 API: DELETE /cache?path=%2FUsers%2Fmichaelsmith%2FLibrary%2FCaches%2Fwash%2Fmnt167843624%2Fdocker%2Fcontainers%2Fstrange_fermat%2Ffs%2Fusr complete

Running the same thing against the parent directory, the fs entry is deleted from the cache.

This appears to happen because wclear clears any cache items related to the entry and its parent. However the fs/usr/local entry itself is derived from the fs entry and there are no actual cache entries that contain it or its parent.

@MikaelSmith MikaelSmith added the bug Something isn't working label Apr 14, 2020
MikaelSmith added a commit to MikaelSmith/wash that referenced this issue Apr 14, 2020
Helps identify that puppetlabs-toy-chest#770 impacts writing volumes.

Signed-off-by: Michael Smith <michael.smith@puppet.com>
MikaelSmith added a commit to MikaelSmith/wash that referenced this issue Apr 15, 2020
Helps identify that puppetlabs-toy-chest#770 impacts writing volumes.

Signed-off-by: Michael Smith <michael.smith@puppet.com>
MikaelSmith added a commit to MikaelSmith/wash that referenced this issue Apr 15, 2020
If an entry is Prefetched, it's parent may not have a List entry but it
may have originated from an earlier ancestor. If there's an immediate
parent that listed the entry still clear it, but if not search for an
ancestor that prefetched child entries and clear that instead.

Fixes puppetlabs-toy-chest#770.

Signed-off-by: Michael Smith <michael.smith@puppet.com>
MikaelSmith added a commit to MikaelSmith/wash that referenced this issue Apr 15, 2020
If an entry is Prefetched, it's parent may not have a cached List entry
but it may have originated from an earlier ancestor. If there's an
immediate parent that listed the entry still clear it, but if not search
for an ancestor that prefetched child entries and clear that instead.

Fixes puppetlabs-toy-chest#770.

Signed-off-by: Michael Smith <michael.smith@puppet.com>
MikaelSmith added a commit to MikaelSmith/wash that referenced this issue Apr 16, 2020
If an entry is Prefetched, it's parent may not have a cached List entry
but it may have originated from an earlier ancestor. If there's an
immediate parent that listed the entry still clear it, but if not search
for a source ancestor clear that instead.

Fixes puppetlabs-toy-chest#770.

Signed-off-by: Michael Smith <michael.smith@puppet.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant