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
osd/PrimaryLogPG: derr when object size becomes over osd_max_object_size #19049
Conversation
src/osd/PrimaryLogPG.cc
Outdated
if (result < 0) { | ||
derr << __func__ | ||
<< " osd_max_object_size >= 4GB; BlueStore has hard limit of 4GB." | ||
<< dendl; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about moving the error logging into check_offset_and_length() instead of duplicating it everywhere that function is called?
src/osd/PrimaryLogPG.cc
Outdated
@@ -5862,7 +5879,10 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops) | |||
break; | |||
} | |||
|
|||
if (op.extent.offset > cct->_conf->osd_max_object_size) { | |||
if (op.extent.offset > osd_max_object_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might as well swap this to use check_offset_and_length() while you're touching it.
src/osd/PrimaryLogPG.cc
Outdated
osd_max_object_size); | ||
if (result < 0) { | ||
derr << __func__ | ||
<< " osd_max_object_size >= 4GB; BlueStore has hard limit of 4GB." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't reference BlueStore or a constant hard limit in the OSD error code (they might be using FileStore!)
Just say it exceeds the max size.
11afbff
to
7309d8c
Compare
@gregsfortytwo Please check when you get a chance. |
That looks better; thanks. |
src/osd/PrimaryLogPG.cc
Outdated
@@ -4245,8 +4245,11 @@ static int check_offset_and_length(uint64_t offset, uint64_t length, uint64_t ma | |||
{ | |||
if (offset >= max || | |||
length > max || | |||
offset + length > max) | |||
offset + length > max) { | |||
std::cerr << __func__ << " " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think the stderr
is available after the ceph-osd is daemonized. please use ldpp_dout()
for printing the log messages in a static function.
src/osd/PrimaryLogPG.cc
Outdated
@@ -5862,8 +5871,9 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops) | |||
break; | |||
} | |||
|
|||
if (op.extent.offset > cct->_conf->osd_max_object_size) { | |||
result = -EFBIG; | |||
if (op.extent.offset > osd_max_object_size) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do this check twice? we already know that the the op will end up with an over-sized object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tchaikov Well, this block is already there. I don't think I added it newly. See:
https://github.com/ceph/ceph/blob/master/src/osd/PrimaryLogPG.cc#L5865-L5868
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i mean, you could drop this line, if you choose to use the helper function. otherwise, we do the check twice after this change.
09eebe6
to
7881e91
Compare
@tchaikov Please check when you get a chance. |
src/osd/PrimaryLogPG.cc
Outdated
@@ -4927,6 +4932,9 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops) | |||
const hobject_t& soid = oi.soid; | |||
bool skip_data_digest = osd->store->has_builtin_csum() && | |||
g_conf->get_val<bool>("osd_skip_data_digest"); | |||
auto osd_max_object_size = cct->_conf->get_val<uint64_t>( | |||
"osd_max_object_size"); | |||
DoutPrefixProvider *dpp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this variable is not initialized.
src/osd/PrimaryLogPG.cc
Outdated
@@ -5700,7 +5708,8 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops) | |||
oi.truncate_size = op.extent.truncate_size; | |||
} | |||
} | |||
result = check_offset_and_length(op.extent.offset, op.extent.length, cct->_conf->osd_max_object_size); | |||
result = check_offset_and_length(op.extent.offset, op.extent.length, | |||
osd_max_object_size, dpp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use get_dpp()
please.
7881e91
to
ffb8cd3
Compare
@tchaikov Please check if you get a chance. |
ffb8cd3
to
e919eb2
Compare
src/osd/PrimaryLogPG.cc
Outdated
result = check_offset_and_length(op.extent.offset, op.extent.length, cct->_conf->osd_max_object_size); | ||
auto dpp = get_dpp(); | ||
result = check_offset_and_length(op.extent.offset, op.extent.length, | ||
osd_max_object_size, dpp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shinobu-x instead of having a dpp
local variable, i'd recommend just use get_dpp()
directly.
1840c10
to
8448c67
Compare
Signed-off-by: Shinobu Kinjo <shinobu@redhat.com>
8448c67
to
e0b6b17
Compare
offset + length > max) | ||
offset + length > max) { | ||
ldpp_dout(dpp, 10) << __func__ << " " | ||
<< "osd_max_object_size >= 4GB; Hard limit of object size is 4GB.\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to print the trailing \n
.
nit, you are hardwiring the max to 4GB, but it is configurable.
Signed-off-by: Shinobu Kinjo shinobu@redhat.com