You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by pa...@apache.org on 2018/03/16 14:05:22 UTC
[trafficserver] branch master updated: Print volume path and more
comment in the code
This is an automated email from the ASF dual-hosted git repository.
paziz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 20543cc Print volume path and more comment in the code
20543cc is described below
commit 20543cc71d613324fa1958b0090e218a3cce2cbb
Author: Persia Aziz <pe...@yahoo-inc.com>
AuthorDate: Thu Mar 15 16:44:04 2018 -0500
Print volume path and more comment in the code
---
iocore/cache/Cache.cc | 18 ++++++++++++------
iocore/cache/CacheDir.cc | 4 ++--
iocore/cache/CacheDisk.cc | 3 +++
3 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index b93ca1e..a9f4ccb 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -192,6 +192,7 @@ static int create_volume(int volume_number, off_t size_in_blocks, int scheme, Ca
static void rebuild_host_table(Cache *cache);
void register_cache_stats(RecRawStatBlock *rsb, const char *prefix);
+// Global list of the volumes created
Queue<CacheVol> cp_list;
int cp_list_len = 0;
ConfigVolumes config_volumes;
@@ -618,6 +619,10 @@ CacheProcessor::start_internal(int flags)
ink_aio_set_callback(new AIO_Callback_handler());
config_volumes.read_config_file();
+
+ /*
+ create CacheDisk objects for each span in the configuration file and store in gdisks
+ */
for (unsigned i = 0; i < theCacheStore.n_disks; i++) {
sd = theCacheStore.disk[i];
char path[PATH_NAME_MAX];
@@ -682,8 +687,6 @@ CacheProcessor::start_internal(int flags)
gdisks[gndisks]->hash_base_string = ats_strdup(sd->hash_base_string);
}
- Debug("cache_hosting", "Disk: %d, blocks: %" PRId64 "", gndisks, blocks);
-
if (sector_size < cache_config_force_sector_size) {
sector_size = cache_config_force_sector_size;
}
@@ -703,6 +706,8 @@ CacheProcessor::start_internal(int flags)
#else
gdisks[gndisks]->open(path, blocks, skip, sector_size, fd, clear);
#endif
+
+ Debug("cache_hosting", "Disk: %d:%s, blocks: %" PRId64 "", gndisks, path, blocks);
fd = -1;
gndisks++;
}
@@ -802,8 +807,8 @@ CacheProcessor::diskInitialized()
/* create the cachevol list only if num volumes are greater
than 0. */
if (config_volumes.num_volumes == 0) {
- res = cplist_reconfigure();
/* if no volumes, default to just an http cache */
+ res = cplist_reconfigure();
} else {
// else
/* create the cachevol list. */
@@ -834,7 +839,8 @@ CacheProcessor::diskInitialized()
CacheDisk *d = gdisks[i];
if (is_debug_tag_set("cache_hosting")) {
int j;
- Debug("cache_hosting", "Disk: %d: Vol Blocks: %u: Free space: %" PRIu64, i, d->header->num_diskvol_blks, d->free_space);
+ Debug("cache_hosting", "Disk: %d:%s: Vol Blocks: %u: Free space: %" PRIu64, i, d->path, d->header->num_diskvol_blks,
+ d->free_space);
for (j = 0; j < (int)d->header->num_volumes; j++) {
Debug("cache_hosting", "\tVol: %d Size: %" PRIu64, d->disk_vols[j]->vol_number, d->disk_vols[j]->size);
}
@@ -1301,8 +1307,8 @@ Vol::init(char *s, off_t blocks, off_t dir_skip, bool clear)
evacuate = (DLL<EvacuationBlock> *)ats_malloc(evac_len);
memset(evacuate, 0, evac_len);
- Debug("cache_init", "allocating %zu directory bytes for a %lld byte volume (%lf%%)", vol_dirlen(this), (long long)this->len,
- (double)vol_dirlen(this) / (double)this->len * 100.0);
+ Debug("cache_init", "Vol %s: allocating %zu directory bytes for a %lld byte volume (%lf%%)", hash_text.get(), vol_dirlen(this),
+ (long long)this->len, (double)vol_dirlen(this) / (double)this->len * 100.0);
raw_dir = nullptr;
if (ats_hugepage_enabled()) {
diff --git a/iocore/cache/CacheDir.cc b/iocore/cache/CacheDir.cc
index 01c76ef..441ae7e 100644
--- a/iocore/cache/CacheDir.cc
+++ b/iocore/cache/CacheDir.cc
@@ -362,8 +362,8 @@ dir_clean_bucket(Dir *b, int s, Vol *vol)
#endif
if (!dir_valid(vol, e) || !dir_offset(e)) {
if (is_debug_tag_set("dir_clean")) {
- Debug("dir_clean", "cleaning %p tag %X boffset %" PRId64 " b %p p %p l %d", e, dir_tag(e), dir_offset(e), b, p,
- dir_bucket_length(b, s, vol));
+ Debug("dir_clean", "cleaning Vol:%s: %p tag %X boffset %" PRId64 " b %p p %p bucket len %d", vol->hash_text.get(), e,
+ dir_tag(e), dir_offset(e), b, p, dir_bucket_length(b, s, vol));
}
if (dir_offset(e)) {
CACHE_DEC_DIR_USED(vol->mutex);
diff --git a/iocore/cache/CacheDisk.cc b/iocore/cache/CacheDisk.cc
index 45432f0..78beffe 100644
--- a/iocore/cache/CacheDisk.cc
+++ b/iocore/cache/CacheDisk.cc
@@ -84,6 +84,8 @@ CacheDisk::open(char *s, off_t blocks, off_t askip, int ahw_sector_size, int fil
header = (DiskHeader *)ats_memalign(ats_pagesize(), header_len);
memset(header, 0, header_len);
+
+ // traffic server was asked to clear the cache, i.e., auto clear cache flag is set
if (clear) {
if (read_only_p) {
fprintf(stderr, "Could not read disk header for disk %s", path);
@@ -96,6 +98,7 @@ CacheDisk::open(char *s, off_t blocks, off_t askip, int ahw_sector_size, int fil
}
}
+ //
SET_HANDLER(&CacheDisk::openStart);
io.aiocb.aio_offset = skip;
io.aiocb.aio_buf = (char *)header;
--
To stop receiving notification emails like this one, please contact
paziz@apache.org.