Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacific: mon: add proxy to cache tier options #50552

Merged
merged 1 commit into from
Nov 28, 2023
Merged
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
2 changes: 1 addition & 1 deletion doc/man/8/ceph.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1314,7 +1314,7 @@ Subcommand ``cache-mode`` specifies the caching mode for cache tier <pool>.

Usage::

ceph osd tier cache-mode <poolname> writeback|readproxy|readonly|none
ceph osd tier cache-mode <poolname> writeback|proxy|readproxy|readonly|none

Subcommand ``remove`` removes the tier <tierpool> (the second one) from base pool
<pool> (the first one).
Expand Down
13 changes: 7 additions & 6 deletions qa/workunits/cephtool/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,28 +350,29 @@ function test_tiering_1()
ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "slow2") | .application_metadata["rados"]' | grep '{}'
ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "cache") | .application_metadata["rados"]' | grep '{}'
ceph osd pool ls detail -f json | jq '.[] | select(.pool_name == "cache2") | .application_metadata["rados"]' | grep '{}'
# forward and proxy are removed/deprecated
# forward is removed/deprecated
expect_false ceph osd tier cache-mode cache forward
expect_false ceph osd tier cache-mode cache forward --yes-i-really-mean-it
expect_false ceph osd tier cache-mode cache proxy
expect_false ceph osd tier cache-mode cache proxy --yes-i-really-mean-it
# test some state transitions
ceph osd tier cache-mode cache writeback
expect_false ceph osd tier cache-mode cache readonly
expect_false ceph osd tier cache-mode cache readonly --yes-i-really-mean-it
ceph osd tier cache-mode cache proxy
ceph osd tier cache-mode cache readproxy
ceph osd tier cache-mode cache none
ceph osd tier cache-mode cache readonly --yes-i-really-mean-it
ceph osd tier cache-mode cache none
ceph osd tier cache-mode cache writeback
ceph osd tier cache-mode cache proxy
ceph osd tier cache-mode cache writeback
expect_false ceph osd tier cache-mode cache none
expect_false ceph osd tier cache-mode cache readonly --yes-i-really-mean-it
# test with dirty objects in the tier pool
# tier pool currently set to 'writeback'
rados -p cache put /etc/passwd /etc/passwd
flush_pg_stats
# 1 dirty object in pool 'cache'
ceph osd tier cache-mode cache readproxy
ceph osd tier cache-mode cache proxy
expect_false ceph osd tier cache-mode cache none
expect_false ceph osd tier cache-mode cache readonly --yes-i-really-mean-it
ceph osd tier cache-mode cache writeback
Expand All @@ -380,7 +381,7 @@ function test_tiering_1()
rados -p cache cache-flush-evict-all
flush_pg_stats
# no dirty objects in pool 'cache'
ceph osd tier cache-mode cache readproxy
ceph osd tier cache-mode cache proxy
ceph osd tier cache-mode cache none
ceph osd tier cache-mode cache readonly --yes-i-really-mean-it
TRIES=0
Expand Down Expand Up @@ -1113,7 +1114,7 @@ function test_mon_mds()

# Removing tier should be permitted because the underlying pool is
# replicated (#11504 case)
ceph osd tier cache-mode mds-tier readproxy
ceph osd tier cache-mode mds-tier proxy
ceph osd tier remove-overlay fs_metadata
ceph osd tier remove fs_metadata mds-tier
ceph osd pool delete mds-tier mds-tier --yes-i-really-really-mean-it
Expand Down
2 changes: 1 addition & 1 deletion src/mon/MonCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -1199,7 +1199,7 @@ COMMAND_WITH_FLAG("osd tier remove "
FLAG(DEPRECATED))
COMMAND("osd tier cache-mode "
"name=pool,type=CephPoolname "
"name=mode,type=CephChoices,strings=writeback|readproxy|readonly|none "
"name=mode,type=CephChoices,strings=writeback|proxy|readproxy|readonly|none "
"name=yes_i_really_mean_it,type=CephBool,req=false",
"specify the caching mode for cache tier <pool>", "osd", "rw")
COMMAND("osd tier set-overlay "
Expand Down
2 changes: 2 additions & 0 deletions src/mon/OSDMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13533,6 +13533,8 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
ss << "unable to set cache-mode '" << pg_pool_t::get_cache_mode_name(mode)
<< "' on a '" << pg_pool_t::get_cache_mode_name(p->cache_mode)
<< "' pool; only '"
<< pg_pool_t::get_cache_mode_name(pg_pool_t::CACHEMODE_PROXY)
<< "','"
<< pg_pool_t::get_cache_mode_name(pg_pool_t::CACHEMODE_READPROXY)
<< "' allowed.";
err = -EINVAL;
Expand Down