Skip to content

Commit 8afc88c

Browse files
authored
Merge pull request ceph#64978 from athanatos/sjust/wip-mclock-cleanup
mclock: avoid using config keys for profiles, remove MonClient from MclockConfig Reviewed-by: Matan Breizman <[email protected]> Reviewed-by: Mohit Agrawal <[email protected]> Reviewed-by: Sridhar Seshasayee <[email protected]>
2 parents bafdbd6 + 12680f8 commit 8afc88c

File tree

12 files changed

+248
-537
lines changed

12 files changed

+248
-537
lines changed

qa/standalone/misc/mclock-config.sh

Lines changed: 0 additions & 158 deletions
Original file line numberDiff line numberDiff line change
@@ -301,164 +301,6 @@ function TEST_backfill_limit_adjustment_mclock() {
301301
teardown $dir || return 1
302302
}
303303

304-
function TEST_profile_disallow_builtin_params_modify() {
305-
local dir=$1
306-
307-
setup $dir || return 1
308-
run_mon $dir a || return 1
309-
run_mgr $dir x || return 1
310-
311-
run_osd $dir 0 --osd_op_queue=mclock_scheduler || return 1
312-
313-
# Verify that the default mclock profile is set on the OSD
314-
local def_mclock_profile=$(ceph config get osd.0 osd_mclock_profile)
315-
test "$def_mclock_profile" = "balanced" || return 1
316-
317-
# Verify the running mClock profile
318-
local cur_mclock_profile=$(CEPH_ARGS='' ceph --format=json daemon \
319-
$(get_asok_path osd.0) config get osd_mclock_profile |\
320-
jq .osd_mclock_profile)
321-
cur_mclock_profile=$(eval echo $cur_mclock_profile)
322-
test $cur_mclock_profile = "high_recovery_ops" || return 1
323-
324-
declare -a options=("osd_mclock_scheduler_background_recovery_res"
325-
"osd_mclock_scheduler_client_res")
326-
327-
local retries=10
328-
local errors=0
329-
for opt in "${options[@]}"
330-
do
331-
# Try and change a mclock config param and confirm that no change occurred
332-
local opt_val_orig=$(CEPH_ARGS='' ceph --format=json daemon \
333-
$(get_asok_path osd.0) config get $opt | jq .$opt | bc)
334-
local opt_val_new=$(echo "$opt_val_orig + 0.1" | bc -l)
335-
ceph config set osd.0 $opt $opt_val_new || return 1
336-
337-
# Check configuration values
338-
for count in $(seq 0 $(expr $retries - 1))
339-
do
340-
errors=0
341-
sleep 2 # Allow time for changes to take effect
342-
343-
echo "Check configuration values - Attempt#: $count"
344-
# Check configuration value on Mon store (or the default) for the osd
345-
local res=$(ceph config get osd.0 $opt) || return 1
346-
echo "Mon db (or default): osd.0 $opt = $res"
347-
if (( $(echo "$res == $opt_val_new" | bc -l) )); then
348-
errors=$(expr $errors + 1)
349-
fi
350-
351-
# Check running configuration value using "config show" cmd
352-
res=$(ceph config show osd.0 | grep $opt |\
353-
awk '{ print $2 }' | bc ) || return 1
354-
echo "Running config: osd.0 $opt = $res"
355-
if (( $(echo "$res == $opt_val_new" | bc -l) || \
356-
$(echo "$res != $opt_val_orig" | bc -l) )); then
357-
errors=$(expr $errors + 1)
358-
fi
359-
360-
# Check value in the in-memory 'values' map is unmodified
361-
res=$(CEPH_ARGS='' ceph --format=json daemon $(get_asok_path \
362-
osd.0) config get $opt | jq .$opt | bc)
363-
echo "Values map: osd.0 $opt = $res"
364-
if (( $(echo "$res == $opt_val_new" | bc -l) || \
365-
$(echo "$res != $opt_val_orig" | bc -l) )); then
366-
errors=$(expr $errors + 1)
367-
fi
368-
369-
# Check if we succeeded or exhausted retry count
370-
if [ $errors -eq 0 ]
371-
then
372-
break
373-
elif [ $count -eq $(expr $retries - 1) ]
374-
then
375-
return 1
376-
fi
377-
done
378-
done
379-
380-
teardown $dir || return 1
381-
}
382-
383-
function TEST_profile_disallow_builtin_params_override() {
384-
local dir=$1
385-
386-
setup $dir || return 1
387-
run_mon $dir a || return 1
388-
run_mgr $dir x || return 1
389-
390-
run_osd $dir 0 --osd_op_queue=mclock_scheduler || return 1
391-
392-
# Verify that the default mclock profile is set on the OSD
393-
local def_mclock_profile=$(ceph config get osd.0 osd_mclock_profile)
394-
test "$def_mclock_profile" = "balanced" || return 1
395-
396-
# Verify the running mClock profile
397-
local cur_mclock_profile=$(CEPH_ARGS='' ceph --format=json daemon \
398-
$(get_asok_path osd.0) config get osd_mclock_profile |\
399-
jq .osd_mclock_profile)
400-
cur_mclock_profile=$(eval echo $cur_mclock_profile)
401-
test $cur_mclock_profile = "high_recovery_ops" || return 1
402-
403-
declare -a options=("osd_mclock_scheduler_background_recovery_res"
404-
"osd_mclock_scheduler_client_res")
405-
406-
local retries=10
407-
local errors=0
408-
for opt in "${options[@]}"
409-
do
410-
# Override a mclock config param and confirm that no change occurred
411-
local opt_val_orig=$(CEPH_ARGS='' ceph --format=json daemon \
412-
$(get_asok_path osd.0) config get $opt | jq .$opt | bc)
413-
local opt_val_new=$(echo "$opt_val_orig + 0.1" | bc -l)
414-
ceph tell osd.0 config set $opt $opt_val_new || return 1
415-
416-
# Check configuration values
417-
for count in $(seq 0 $(expr $retries - 1))
418-
do
419-
errors=0
420-
sleep 2 # Allow time for changes to take effect
421-
422-
echo "Check configuration values - Attempt#: $count"
423-
# Check configuration value on Mon store (or the default) for the osd
424-
local res=$(ceph config get osd.0 $opt) || return 1
425-
echo "Mon db (or default): osd.0 $opt = $res"
426-
if (( $(echo "$res == $opt_val_new" | bc -l) )); then
427-
errors=$(expr $errors + 1)
428-
fi
429-
430-
# Check running configuration value using "config show" cmd
431-
res=$(ceph config show osd.0 | grep $opt |\
432-
awk '{ print $2 }' | bc ) || return 1
433-
echo "Running config: osd.0 $opt = $res"
434-
if (( $(echo "$res == $opt_val_new" | bc -l) || \
435-
$(echo "$res != $opt_val_orig" | bc -l) )); then
436-
errors=$(expr $errors + 1)
437-
fi
438-
439-
# Check value in the in-memory 'values' map is unmodified
440-
res=$(CEPH_ARGS='' ceph --format=json daemon $(get_asok_path \
441-
osd.0) config get $opt | jq .$opt | bc)
442-
echo "Values map: osd.0 $opt = $res"
443-
if (( $(echo "$res == $opt_val_new" | bc -l) || \
444-
$(echo "$res != $opt_val_orig" | bc -l) )); then
445-
errors=$(expr $errors + 1)
446-
fi
447-
448-
# Check if we succeeded or exhausted retry count
449-
if [ $errors -eq 0 ]
450-
then
451-
break
452-
elif [ $count -eq $(expr $retries - 1) ]
453-
then
454-
return 1
455-
fi
456-
done
457-
done
458-
459-
teardown $dir || return 1
460-
}
461-
462304
main mclock-config "$@"
463305

464306
# Local Variables:

0 commit comments

Comments
 (0)