Re: Message decode issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 23, 2018 at 9:25 AM, 陶冬冬 <tdd21151186@xxxxxxxxx> wrote:
> Dear Cephers,
>
> below is a piece of code in Message::decode_message:
> ```
> // m->header.version, if non-zero, should be populated with the
>   // newest version of the encoding the code supports.  If set, check
>   // it against compat_version.
>   if (m->get_header().version &&
>       m->get_header().version < header.compat_version) {
>     if (cct) {
>       ldout(cct, 0) << "will not decode message of type " << type
>                     << " version " << header.version
>                     << " because compat_version " << header.compat_version
>                     << " > supported version " << m->get_header().version << dendl;
>       if (cct->_conf->ms_die_on_bad_msg)
>         ceph_abort();
>     }
>     m->put();
>     return 0;
>   }
> ```
> I know it’s checking the compatibility of the incoming message.
> but, i think it’s not sufficient, it only checked if the coming message’s compat_version is bigger than our version (if it’s true, the message is not supported)
> it should also check if the comming message’s version  is smaller than our compat_version, right ?

No. A message older than us may still be understandable by us. Many of
the message decode functions branch to deal with older messages, and
we have a lot of code to communicate with older message types to older
daemons.
-Greg

> please correct me if i’m wrong.
>
> Regards,
> Dongdong--
> To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux