Hi Canh

Ack

Thanks
Lennart

> -----Original Message-----
> From: Canh Van Truong [mailto:[email protected]]
> Sent: den 24 maj 2017 13:59
> To: Lennart Lund <[email protected]>; Vu Minh Nguyen
> <[email protected]>; [email protected]
> Cc: [email protected]; Canh Van Truong
> <[email protected]>
> Subject: [PATCH 1/1] log: fix log agent does not use client version when
> recovery [#2457]
> 
> When log agent recover the client, it uses the highest version that log agent
> supported to re-intialize client.
> 
> It should use the client version to re-initialize client.
> ---
>  src/log/agent/lga_state.cc | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/src/log/agent/lga_state.cc b/src/log/agent/lga_state.cc
> index 5d45c0e78..a532fa69e 100644
> --- a/src/log/agent/lga_state.cc
> +++ b/src/log/agent/lga_state.cc
> @@ -52,15 +52,10 @@ static int start_recovery2_thread(void);
>   * The server returns a client id
>   *
>   * @param client_id[out]
> + * @param version[in]
>   * @return -1 on error (client id not valid)
>   */
> -static int send_initialize_msg(uint32_t *client_id) {
> -  SaVersionT version = {
> -    .releaseCode = LOG_RELEASE_CODE,
> -    .majorVersion = LOG_MAJOR_VERSION,
> -    .minorVersion = LOG_MINOR_VERSION
> -  };
> -
> +static int send_initialize_msg(uint32_t *client_id, SaVersionT *version) {
>    SaAisErrorT ais_rc = SA_AIS_ERR_TRY_AGAIN;
>    uint32_t ncs_rc = NCSCC_RC_SUCCESS;
>    int rc = 0;
> @@ -74,7 +69,7 @@ static int send_initialize_msg(uint32_t *client_id) {
>    memset(&i_msg, 0, sizeof(lgsv_msg_t));
>    i_msg.type = LGSV_LGA_API_MSG;
>    i_msg.info.api_info.type = LGSV_INITIALIZE_REQ;
> -  i_msg.info.api_info.param.init.version = version;
> +  i_msg.info.api_info.param.init.version = *version;
> 
>    /* Send a message to LGS to obtain a client_id
>     */
> @@ -224,6 +219,7 @@ static int initialize_one_client(lga_client_hdl_rec_t
> *p_client) {
> 
>    osaf_mutex_lock_ordie(&lga_cb.cb_lock);
>    bool initialized_flag = p_client->initialized_flag;
> +  SaVersionT version = p_client->version;
>    osaf_mutex_unlock_ordie(&lga_cb.cb_lock);
>    if (initialized_flag == true) {
>      /* The client is already initialized */
> @@ -231,7 +227,7 @@ static int initialize_one_client(lga_client_hdl_rec_t
> *p_client) {
>      goto done;
>    }
> 
> -  rc = send_initialize_msg(&client_id);
> +  rc = send_initialize_msg(&client_id, &version);
>    if (rc == -1) {
>      TRACE("%s initialize_msg_send Fail", __FUNCTION__);
>    }
> --
> 2.11.0


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to