"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tests/integration/rdb.tcl" between
redis-6.2-rc3.tar.gz and redis-6.2.0.tar.gz

About: redis is an advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

rdb.tcl  (redis-6.2-rc3):rdb.tcl  (redis-6.2.0)
skipping to change at line 209 skipping to change at line 209
# no need to keep waiting for loading to complete # no need to keep waiting for loading to complete
exec kill [srv 0 pid] exec kill [srv 0 pid]
} }
} }
# Our COW metrics (Private_Dirty) work only on Linux # Our COW metrics (Private_Dirty) work only on Linux
set system_name [string tolower [exec uname -s]] set system_name [string tolower [exec uname -s]]
if {$system_name eq {linux}} { if {$system_name eq {linux}} {
start_server {overrides {save ""}} { start_server {overrides {save ""}} {
test {Test child sending COW info} { test {Test child sending info} {
# make sure that rdb_last_cow_size and current_cow_size are zero (the te st using new server), # make sure that rdb_last_cow_size and current_cow_size are zero (the te st using new server),
# so that the comparisons during the test will be valid # so that the comparisons during the test will be valid
assert {[s current_cow_size] == 0} assert {[s current_cow_size] == 0}
assert {[s current_save_keys_processed] == 0}
assert {[s current_save_keys_total] == 0}
assert {[s rdb_last_cow_size] == 0} assert {[s rdb_last_cow_size] == 0}
# using a 200us delay, the bgsave is empirically taking about 10 seconds . # using a 200us delay, the bgsave is empirically taking about 10 seconds .
# we need it to take more than some 5 seconds, since redis only report C OW once a second. # we need it to take more than some 5 seconds, since redis only report C OW once a second.
r config set rdb-key-save-delay 200 r config set rdb-key-save-delay 200
r config set loglevel debug r config set loglevel debug
# populate the db with 10k keys of 4k each # populate the db with 10k keys of 4k each
set rd [redis_deferring_client 0] set rd [redis_deferring_client 0]
set size 4096 set size 4096
skipping to change at line 237 skipping to change at line 240
for {set k 0} {$k < $cmd_count} {incr k} { for {set k 0} {$k < $cmd_count} {incr k} {
catch { $rd read } catch { $rd read }
} }
$rd close $rd close
# start background rdb save # start background rdb save
r bgsave r bgsave
set current_save_keys_total [s current_save_keys_total]
if {$::verbose} {
puts "Keys before bgsave start: current_save_keys_total"
}
# on each iteration, we will write some key to the server to trigger cop y-on-write, and # on each iteration, we will write some key to the server to trigger cop y-on-write, and
# wait to see that it reflected in INFO. # wait to see that it reflected in INFO.
set iteration 1 set iteration 1
while 1 { while 1 {
# take a sample before writing new data to the server # take samples before writing new data to the server
set cow_size [s current_cow_size] set cow_size [s current_cow_size]
if {$::verbose} { if {$::verbose} {
puts "COW info before copy-on-write: $cow_size" puts "COW info before copy-on-write: $cow_size"
} }
set keys_processed [s current_save_keys_processed]
if {$::verbose} {
puts "current_save_keys_processed info : $keys_processed"
}
# trigger copy-on-write # trigger copy-on-write
r setrange key$iteration 0 [string repeat B $size] r setrange key$iteration 0 [string repeat B $size]
# wait to see that current_cow_size value updated (as long as the ch ild is in progress) # wait to see that current_cow_size value updated (as long as the ch ild is in progress)
wait_for_condition 80 100 { wait_for_condition 80 100 {
[s rdb_bgsave_in_progress] == 0 || [s rdb_bgsave_in_progress] == 0 ||
[s current_cow_size] >= $cow_size + $size [s current_cow_size] >= $cow_size + $size &&
[s current_save_keys_processed] > $keys_processed &&
[s current_fork_perc] > 0
} else { } else {
if {$::verbose} { if {$::verbose} {
puts "COW info on fail: [s current_cow_size]" puts "COW info on fail: [s current_cow_size]"
puts [exec tail -n 100 < [srv 0 stdout]] puts [exec tail -n 100 < [srv 0 stdout]]
} }
fail "COW info wasn't reported" fail "COW info wasn't reported"
} }
# assert that $keys_processed is not greater than total keys.
assert_morethan_equal $current_save_keys_total $keys_processed
# for no accurate, stop after 2 iterations # for no accurate, stop after 2 iterations
if {!$::accurate && $iteration == 2} { if {!$::accurate && $iteration == 2} {
break break
} }
# stop iterating if the bgsave completed # stop iterating if the bgsave completed
if { [s rdb_bgsave_in_progress] == 0 } { if { [s rdb_bgsave_in_progress] == 0 } {
break break
} }
 End of changes. 7 change blocks. 
3 lines changed or deleted 21 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)