Skip to content

Commit

Permalink
[clean_a_cache_with_large_blocks]
Browse files Browse the repository at this point in the history
Cleaning doesn't work if the block size is over 1M!
  • Loading branch information
jthornber committed Jan 7, 2019
1 parent b77f941 commit 9d79289
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions lib/dmtest/tests/cache/background_writeback_tests.rb
Expand Up @@ -129,6 +129,33 @@ def cache_remains_clean_through_reload(policy, metadata_version)
def filter_writes(events)
events.select {|e| e.code.member?(:write)}
end

#--------------------------------

define_test :clean_a_cache_with_large_blocks do
cache_size = gig(1)
block_size = meg(2)

s = CacheStack.new(@dm, @metadata_dev, @data_dev,
:policy => Policy.new("smq", :migration_threshold => 1024),
:format => false,
:cache_size => cache_size,
:block_size => block_size,
:metadata_version => 2)
s.activate_support_devs do
s.prepare_populated_cache(:dirty_percentage => 100)
traces, _ = blktrace(s.origin) do
s.activate_top_level do
# Writeback needs to be done in a timely manner
Timeout::timeout(180) do
wait_for_all_clean(s.cache)
end
end
end

assert_equal(cache_size / block_size, filter_writes(traces[0]).size)
end
end
end

#----------------------------------------------------------------

0 comments on commit 9d79289

Please sign in to comment.