[
https://issues.apache.org/jira/browse/MESOS-2736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14602256#comment-14602256
]
Marco Massenzio commented on MESOS-2736:
----------------------------------------
Following from some email conversation, I'm reporting here a proposal to add
{{VersionInfo}} to the {{MasterInfo}} PB:
{quote}
Regarding version - we have {{mesos/version.hpp}} (apparently a generated file
{{configure.ac}}:
{noformat}
AC_INIT([mesos], [0.23.0]) )
{noformat}
which we could easily use in {{createMasterInfo()}} to assemble the version.
The problem with string-based version is that it's virtually impossible to come
up with anything that will allow to terminally decide if version-x < version-y
-- which is the very problem that [Semantic Versioning|http://semver.org] was
meant to deal with.
Something like:
{code}
message MasterInfo {
message Version {
message SemanticVersion {
required string major = 1;
required string minor = 2;
optional string patch = 3;
}
required SemanticVersion semanticVersion = 1;
optional string build = 2;
}
// ... other stuff
optional Version versionInfo = 98;
optional string version = 99;
}
{code}
and we build a full version by concatenating the fields, with the optional
build:
{code}
std::string version(const MasterInfo& masterInfo)
{
MasterInfo::Version::SemanticVersion semanticVersion =
masterInfo.versionInfo().semanticVersion();
return semanticVersion.major() + "." + semanticVersion.minor() +
(semanticVersion.hasPatch() ? "." + semanticVersion.patch() : "") +
(masterInfo.versionInfo().hasBuild() ?
"-" + masterInfo.versionInfo().build() : "");
}
{code}
you get the idea :)
This way, we use canonically the semanticVersion to decide "precedence" (and,
ideally, "distance" too) but folks can add whichever decoration they choose to
enrich the Mesos version number.
{quote}
> Upgrade the design of MasterInfo
> --------------------------------
>
> Key: MESOS-2736
> URL: https://issues.apache.org/jira/browse/MESOS-2736
> Project: Mesos
> Issue Type: Improvement
> Reporter: Marco Massenzio
> Assignee: Marco Massenzio
> Labels: mesosphere
>
> Currently, the {{MasterInfo}} PB only supports an {{ip}} field as an
> {{int32}}.
> Beyond making it harder (and opaque; open to subtle bugs) for languages other
> than C/C++ to decode into an IPv4 octets, this does not allow Mesos to
> support IPv6 Master nodes.
> We should consider ways to upgrade it in ways that permit us to support both
> IPv4 / IPv6 nodes, and, possibly, in a way that makes it easy for languages
> such as Java/Python that already have PB support, so could easily deserialize
> this information.
> See also MESOS-2709 for more info.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)