Menu

#2336 logsv saLogInitialize() returns SA_AIS_ERR_VERSION for invalid minor version

5.2.RC1
duplicate
nobody
None
defect
log
-
5.2.FC
major
2017-03-06
2017-03-03
Ritu Raj
No

Environment details

OS : Suse 64bit
Changeset : 8634( 5.2.FC)

Summary

logsv saLogInitialize() returns SA_AIS_ERR_VERSION if values of minor_version is other than [0,1,2,3]

Steps

  1. saLogInitialize() with version [A.2.100]
    got return value SA_AIS_ERR_VERSION

In case if user provide unsupported minor version it should set highest value of the minor version that this implementation can support for the required value of releaseCode and the returned value of majorVersion

As per spec "SAI-AIS-LOG-A.02.01" section "3.5.1":
"version - [in/out] As an input parameter, version is a pointer to a structure containing
the required Log Service version. In this case, minorVersion is ignored and should be
set to 0x00"

If the preceding condition cannot be met, SA_AIS_ERR_VERSION is returned, and
the structure pointed to by the version parameter is set to:
if (implementation supports the required releaseCode)
releaseCode = required releaseCode
else {
if (implementation supports releaseCode higher than the required
releaseCode)
releaseCode = the lowest value of the supported release codes that is
higher than the required releaseCode
else
releaseCode = the highest value of the supported release codes that is
lower than the required releaseCode
}

In following lines I can see some changes:

src/log/agent/lga_api.c

static bool is_log_version_valid(const SaVersionT *ver) {
        bool rc = false;
        if ((ver->releaseCode == LOG_RELEASE_CODE) &&
            (ver->majorVersion <= LOG_MAJOR_VERSION) &&
            (ver->majorVersion > 0) &&
            (ver->minorVersion <= LOG_MINOR_VERSION)) {
                rc = true;
        }
        return rc;
}
....
....
TRACE("version FAILED, required: %c.%u.%u, supported: %c.%u.%u\n",
                      version->releaseCode, version->majorVersion, version->minorVersion,
                      LOG_RELEASE_CODE, LOG_MAJOR_VERSION, LOG_MINOR_VERSION);
                version->releaseCode = LOG_RELEASE_CODE;
                version->majorVersion = LOG_MAJOR_VERSION;
                version->minorVersion = LOG_MINOR_VERSION;
                ais_rc = SA_AIS_ERR_VERSION;
                goto done
Below is the snippet of agent traces::

Mar 2 23:14:00.124164 lga [27362:src/log/agent/lga_api.c:0175] >> saLogInitialize
Mar 2 23:14:00.124193 lga [27362:src/log/agent/lga_api.c:0199] TR version FAILED, required: A.2.100, supported: A.2.3
Mar 2 23:14:00.124201 lga [27362:src/log/agent/lga_api.c:0322] << saLogInitialize: client_id = 0
Mar 2 23:14:00.144561 lga [27406:src/imm/agent/imma_om_api.cc:0165] >> saImmOmInitialize
Mar 2 23:14:00.144588 lga [27406:src/imm/agent/imma_om_api.cc:0191] TR OM client version A.2.17

Related

Tickets: #2200

Discussion

  • elunlen

    elunlen - 2017-03-03

    Yes, it is correct that the Log AIS says that minor version is ignored and should be set to 0x00. This means that to use minor version is in some sense NBC but only if you try to set a minor version that is not relevant e.g. 100 as in your test case. It is still possible to use version 0x00 and 0x01 as before and this should be considered backwards compatible enough since the benefits of being able to use minor version is very beneficial. Also note that minor version is specified in another way if you look at the Description part of the “Initialize” section 3.5.1 in the Log AIS.

    Today it’s a problem to report back to the client the correct highest supported version because sending this information from the server to the agent is not supported by the current version of the protocol between the agent and the server and it cannot be added since minor version handling does not work/is used. This means that correct information cannot be given to the client since there is no information about the highest version supported by the log server. In this release minor version checking is implemented in the server meaning that if a minor version higher than 0x03 is give a version error is returned to the agent. The agent will then set the version[out] to minor version 0x03 and return version error to the client.

    I strongly recommend that we keep the now implemented behavior and do not follow strictly the paragraph saying that minor version shall be ignored.

    For more information, see also the updated Log PR document that is currently on review, ticket [#2200] (document attached)

     

    Related

    Tickets: #2200

  • Ritu Raj

    Ritu Raj - 2017-03-03

    I gone through the attached PR document,
    Please, Can you update the PR doc specifically for minor version.

    Points can be added in PR doc-
    * If Initialize with other than supported minor version [current supported minor version{0,1,2,3}] api should return "SA_AIS_ERR_VERSION"

     
  • Canh Truong

    Canh Truong - 2017-03-06

    The version handling has already implemented in ticket #2146. Your comments will be updated in PR document. The ticket PR document was raised in ticket #2200. So I will update the ticket status to duplicate

     
  • Canh Truong

    Canh Truong - 2017-03-06
    • status: unassigned --> duplicate
     

Log in to post a comment.