inconsistency in cache entry "freshness" testing

Bug #674129 reported by Brian J. Murrell on 2010-11-11
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Dmitrii Zagorodnov

Bug Description

In ok_to_cache() the cache is scanned and the mtime of the "path" member of the cache entry is used for aging, yet in get_cached_file() when an entry is taken from the cache, the digest file, not the cache_entry->path file is touched to keep the cache entry "fresh"

I think the following patch to storage/storage.c fixes it:

@@ -325,8 +331,12 @@ static int ok_to_cache (const char * cached_path, const long long file_size_byte
         struct stat mystat;
         cache_entry * e;
         for ( e = cache_head; e; e=e->next) {
+ /* since the VERIFY state in get_cached_file() touches the
+ * _digest_ file, we must use that file here for cache aging */
+ char digest_path[BUFSIZE];
+ snprintf (digest_path, BUFSIZE, "%s-digest", e->path);
             if (stat (e->path, &mystat)<0) {
- logprintfl (EUCAERROR, "error: ok_to_cache() can't stat %s\n", cached_path);
+ logprintfl (EUCAERROR, "error: ok_to_cache() can't stat %s\n", digest_path);
                 return 0;
             if (mystat.st_mtime<oldest_mtime) {

Neil Soman (neilsoman) wrote :

Brian, thanks for the patch. Could you kindly apply as a contributor (or reference your ID if you already are one)? The online process should take only a few minutes of your time.


Daniel Nurmi (nurmi) on 2010-11-15
Changed in eucalyptus:
assignee: nobody → Dmitrii Zagorodnov (dmitrii)

Neil, I am trying to chase down where we are in the CA process with my management.

Andy Grimm (agrimm) wrote :

This issue is now being tracked upstream at

Please watch that issue for further updates.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers