Skip to content

messages: MOSDOpReply encode and decode errorcode32_t with PGID64 fea… - #65962

Merged
SrinivasaBharath merged 3 commits into
ceph:mainfrom
NitzanMordhai:wip-nitzan-MOSDOpReply-pgid64-encode-decode-fix
Nov 13, 2025
Merged

SrinivasaBharath merged 3 commits into
ceph:mainfrom
NitzanMordhai:wip-nitzan-MOSDOpReply-pgid64-encode-decode-fix

Conversation

@NitzanMordhai

@NitzanMordhai NitzanMordhai commented Oct 15, 2025 •

Copy link
Copy Markdown
Contributor

…tures on

we used to have raw encode\decode of results when PGID64 features is on. we should use errorcode32_t os convertions using set\get wire.

Fixes: https://tracker.ceph.com/issues/69814

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands

You must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right. Can you also update the parameter name for

ceph/src/include/types.h

Lines 544 to 546 in e288069

inline void set_wire_to_host(code_t host_code) {
code = ceph_to_hostos_errno(host_code);
}

to be inline void set_wire_to_host(code_t wire_code) {.

@batrick

batrick commented Oct 16, 2025

Copy link
Copy Markdown
Member

jenkins test make check

@batrick

batrick commented Oct 16, 2025

Copy link
Copy Markdown
Member

jenkins test api

flags = head.flags;
bad_replay_version = head.reassert_version;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed in another commit though?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, will move it. found that while i was doing some new test with ceph-dencoder with set_features for PGID64

@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

to be inline void set_wire_to_host(code_t wire_code) {.

Also changing it to const, if we are already touching that one..

@NitzanMordhai
NitzanMordhai force-pushed the wip-nitzan-MOSDOpReply-pgid64-encode-decode-fix branch from 6e45ebc to ddf6b79 Compare October 16, 2025 14:11
@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

to be inline void set_wire_to_host(code_t wire_code) {.

Also changing it to const, if we are already touching that one..

@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@NitzanMordhai

Copy link
Copy Markdown
Contributor Author

jenkins test docs

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Let's bake for a while in main before backporting.

Comment thread src/include/types.h
@@ -541,8 +541,8 @@ struct errorcode32_t {
return hostos_to_ceph_errno(code);
}

inline void set_wire_to_host(code_t host_code) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment thread src/include/types.h Outdated
@@ -541,8 +541,8 @@ struct errorcode32_t {
return hostos_to_ceph_errno(code);
}

inline void set_wire_to_host(code_t host_code) {
code = ceph_to_hostos_errno(host_code);
inline void set_wire_to_host(const code_t wire_code) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const value parameters are a kind of anti-pattern. Let's remove that.

@batrick batrick left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise LGTM

…tures on

we used to have raw encode\decode of results when PGID64 features is on.
we should use errorcode32_t os convertions using set\get wire.

Fixes: https://tracker.ceph.com/issues/69814
Signed-off-by: Nitzan Mordechai <[email protected]>
When decoding an old version of MOSDOpReplay or when the PGID64
feature is enabled, bad_replay_version is not being set, which
causes inconsistent output in ceph-dencoder.

To fix this, set bad_replay_version to the head reassert_version
value. This ensures that if the struct is later re-encoded, the
decode output will be consistent.

Fixes: https://tracker.ceph.com/issues/69814
Signed-off-by: Nitzan Mordechai <[email protected]>
@NitzanMordhai
NitzanMordhai force-pushed the wip-nitzan-MOSDOpReply-pgid64-encode-decode-fix branch from ddf6b79 to 6eb0dae Compare October 21, 2025 04:54
@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test windows

@ljflores

Copy link
Copy Markdown
Member

@lee-j-sanders

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants