inconsistency in cache entry "freshness" testing
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;
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_
+ 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);
}
if (mystat.
Changed in eucalyptus: | |
assignee: | nobody → Dmitrii Zagorodnov (dmitrii) |
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/participat e/contribute# contributor
thanks!