inconsistency in cache entry "freshness" testing

Bug #674129 reported by Brian J. Murrell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Eucalyptus
New
Undecided
Dmitrii Zagorodnov
2.0
New
Undecided
Unassigned

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) {

Revision history for this message
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.

http://open.eucalyptus.com/participate/contribute#contributor

thanks!

Daniel Nurmi (nurmi)
Changed in eucalyptus:
assignee: nobody → Dmitrii Zagorodnov (dmitrii)
Revision history for this message
Brian J. Murrell (brian-interlinx) wrote :

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

Revision history for this message
Andy Grimm (agrimm) wrote :

This issue is now being tracked upstream at http://eucalyptus.atlassian.net/browse/EUCA-2737

Please watch that issue for further updates.

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

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.