⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions src/iocore/cache/CacheTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -432,9 +432,14 @@ force_link_CacheTest()

REGRESSION_TEST(cache_disk_replacement_stability)(RegressionTest *t, int level, int *pstatus)
{
static int const MAX_VOLS = 26; // maximum values used in any test.
static uint64_t DEFAULT_SKIP = 8192;
static uint64_t DEFAULT_STRIPE_SIZE = 1024ULL * 1024 * 1024 * 911; // 911G
static int const MAX_VOLS = 26; // maximum values used in any test.
static uint64_t DEFAULT_SKIP = 8192;
// Reduced from 911GB to 1GB for CI stability. The Stripe constructor
// allocates a directory buffer proportional to stripe size, and 26 stripes
// of 911GB each exhausted memory in CI environments (especially under
// Valgrind). The hash stability algorithm works identically regardless of
// absolute stripe size.
static uint64_t DEFAULT_STRIPE_SIZE = 1024ULL * 1024 * 1024; // 1GB
CacheDisk disk; // Only need one because it's just checked for failure.
CacheHostRecord hr1, hr2;
StripeSM *sample;
Expand Down Expand Up @@ -471,7 +476,7 @@ REGRESSION_TEST(cache_disk_replacement_stability)(RegressionTest *t, int level,
hr2.num_vols = MAX_VOLS;

sample = stripes[sample_idx].get();
sample->len = 1024ULL * 1024 * 1024 * (1024 + 128); // 1.1 TB
sample->len = 1024ULL * 1024 * 1024 + 256ULL * 1024 * 1024; // 1.25GB (proportional increase from 1GB)
snprintf(buff, sizeof(buff), "/dev/sd%c %" PRIu64 ":%" PRIu64, 'a' + sample_idx, DEFAULT_SKIP, sample->len);
CryptoContext().hash_immediate(sample->hash_id, buff, strlen(buff));
build_vol_hash_table(&hr2);
Expand Down Expand Up @@ -566,6 +571,7 @@ test_RamCache(RegressionTest *t, RamCache *cache, const char *name, int64_t cach
CryptoHash hash;

d->alloc(BUFFER_SIZE_INDEX_16K);
memset(d->data(), 0, BUFFER_SIZE_FOR_INDEX(BUFFER_SIZE_INDEX_16K));
data.push_back(make_ptr(d));
hash.u64[0] = (static_cast<uint64_t>(i) << 32) + i;
hash.u64[1] = (static_cast<uint64_t>(i) << 32) + i;
Expand Down Expand Up @@ -610,6 +616,7 @@ test_RamCache(RegressionTest *t, RamCache *cache, const char *name, int64_t cach
if (!cache->get(&hash, &get_data)) {
IOBufferData *d = THREAD_ALLOC(ioDataAllocator, this_thread());
d->alloc(BUFFER_SIZE_INDEX_16K);
memset(d->data(), 0, d->block_size());
data.push_back(make_ptr(d));
cache->put(&hash, data.back().get(), 1 << 15);
if (i >= sample_size / 2) {
Expand All @@ -630,6 +637,7 @@ test_RamCache(RegressionTest *t, RamCache *cache, const char *name, int64_t cach
if (!cache->get(&hash, &get_data)) {
IOBufferData *d = THREAD_ALLOC(ioDataAllocator, this_thread());
d->alloc(BUFFER_SIZE_INDEX_8K + (r[i] % 3));
memset(d->data(), 0, d->block_size());
data.push_back(make_ptr(d));
cache->put(&hash, data.back().get(), d->block_size());
if (i >= sample_size / 2) {
Expand Down
5 changes: 3 additions & 2 deletions src/iocore/cache/Stripe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,9 @@ Stripe::_init_directory(std::size_t directory_size, int header_size, int footer_
this->directory.raw_dir_huge = false;
}
this->directory.raw_dir_size = directory_size;
this->directory.dir = reinterpret_cast<Dir *>(this->directory.raw_dir + header_size);
this->directory.header = reinterpret_cast<StripeHeaderFooter *>(this->directory.raw_dir);
memset(this->directory.raw_dir, 0, directory_size);
this->directory.dir = reinterpret_cast<Dir *>(this->directory.raw_dir + header_size);
this->directory.header = reinterpret_cast<StripeHeaderFooter *>(this->directory.raw_dir);
std::size_t const footer_offset{directory_size - static_cast<std::size_t>(footer_size)};
this->directory.footer = reinterpret_cast<StripeHeaderFooter *>(this->directory.raw_dir + footer_offset);
}
Expand Down
2 changes: 2 additions & 0 deletions src/proxy/logging/LogBuffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ LogBuffer::LogBuffer(const LogConfig *cfg, LogObject *owner, size_t size, size_t
}
m_buffer = static_cast<char *>(align_pointer_forward(m_unaligned_buffer, buf_align));

memset(m_buffer, 0, size);

// add the header
hdr_size = _add_buffer_header(cfg);

Expand Down