Re: [devel] [PATCH 1/1] lgs: map the CkptPushAsync to the right memory [#3183]

2020-05-11 Thread Thuan Tran
Hi Thien,

ACK from me.

Best Regards,
ThuanTr

-Original Message-
From: Thien Minh Huynh  
Sent: Tuesday, May 12, 2020 1:33 PM
To: Thuan Tran ; Vu Minh Nguyen 

Cc: opensaf-devel@lists.sourceforge.net; Thien Minh Huynh 

Subject: [PATCH 1/1] lgs: map the CkptPushAsync to the right memory [#3183]

The standby logsv is crashed during cold sync if having pending
write requests in the queue.That happens because the CkptPushAsync
data for decoding is referring to wrong data.

The fix is to map the CkptPushAsync to the right memory.
---
 src/log/logd/lgs_cache.cc | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
index e3583e97c..27e33702d 100644
--- a/src/log/logd/lgs_cache.cc
+++ b/src/log/logd/lgs_cache.cc
@@ -344,14 +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, 
lgsv_ckpt_header_t* header,
   uint32_t num_rec = header->num_ckpt_records;
   int rc = NCSCC_RC_SUCCESS;
   EDU_ERR ederror;
-  lgsv_ckpt_msg_v8_t msg_v8;
-  auto data = &msg_v8.ckpt_rec.push_async;
-  CkptPushAsync* cache_data;
   while (num_rec) {
-cache_data = data;
 rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
 uba, EDP_OP_TYPE_DEC,
-&cache_data, &ederror);
+vckpt_rec, &ederror);
 if (rc != NCSCC_RC_SUCCESS) {
   m_NCS_EDU_PRINT_ERROR_STRING(ederror);
   return rc;
-- 
2.17.1



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] lgs: map the CkptPushAsync to the right memory [#3183]

2020-05-11 Thread thien.m.huynh
The standby logsv is crashed during cold sync if having pending
write requests in the queue.That happens because the CkptPushAsync
data for decoding is referring to wrong data.

The fix is to map the CkptPushAsync to the right memory.
---
 src/log/logd/lgs_cache.cc | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
index e3583e97c..27e33702d 100644
--- a/src/log/logd/lgs_cache.cc
+++ b/src/log/logd/lgs_cache.cc
@@ -344,14 +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, 
lgsv_ckpt_header_t* header,
   uint32_t num_rec = header->num_ckpt_records;
   int rc = NCSCC_RC_SUCCESS;
   EDU_ERR ederror;
-  lgsv_ckpt_msg_v8_t msg_v8;
-  auto data = &msg_v8.ckpt_rec.push_async;
-  CkptPushAsync* cache_data;
   while (num_rec) {
-cache_data = data;
 rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
 uba, EDP_OP_TYPE_DEC,
-&cache_data, &ederror);
+vckpt_rec, &ederror);
 if (rc != NCSCC_RC_SUCCESS) {
   m_NCS_EDU_PRINT_ERROR_STRING(ederror);
   return rc;
-- 
2.17.1



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for lgs: map the CkptPushAsync to the right memory [#3183] V2

2020-05-11 Thread thien.m.huynh
Summary: lgs: map the CkptPushAsync to the right memory [#3183]
Review request for Ticket(s): 3183
Peer Reviewer(s): Thuan, Vu
Pull request to: Thuan
Affected branch(es): develop
Development branch: ticket-3183
Base revision: b2497e28ef679c4d210955b058f710c1c6954220
Personal repository: git://git.code.sf.net/u/thienhuynh/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 51d404c105c1bb39ce908aa99f5b78cdcf95f1da
Author: thien.m.huynh 
Date:   Tue, 12 May 2020 09:48:58 +0700

lgs: map the CkptPushAsync to the right memory [#3183]

The standby logsv is crashed during cold sync if having pending
write requests in the queue.That happens because the CkptPushAsync
data for decoding is referring to wrong data.

The fix is to map the CkptPushAsync to the right memory.



Complete diffstat:
--
 src/log/logd/lgs_cache.cc | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)


Testing Commands:
-
N/A

Testing, Expected Results:
--
N/A

Conditions of Submission:
-
ACK from reviewers

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

2020-05-11 Thread Thien Minh Huynh
Hi Thuan,

Thanks for your idea. Your idea can solve the issue. I will send V2.

Best Regards,
ThienHuynh

From: Thuan Tran 
Sent: Tuesday, May 12, 2020 8:24 AM
To: Thien Minh Huynh ; Vu Minh Nguyen 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold 
sync [#3183]

Hi Thien,

In my understanding, push_async is vckpt_rec.
I wonder if below idea can solve the issue?

diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
index e3583e97c..27e33702d 100644
--- a/src/log/logd/lgs_cache.cc
+++ b/src/log/logd/lgs_cache.cc
@@ -344,14 +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, 
lgsv_ckpt_header_t* header,
   uint32_t num_rec = header->num_ckpt_records;
   int rc = NCSCC_RC_SUCCESS;
   EDU_ERR ederror;
-  lgsv_ckpt_msg_v8_t msg_v8;
-  auto data = &msg_v8.ckpt_rec.push_async;
-  CkptPushAsync* cache_data;
   while (num_rec) {
-cache_data = data;
 rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
 uba, EDP_OP_TYPE_DEC,
-&cache_data, &ederror);
+vckpt_rec, &ederror);
 if (rc != NCSCC_RC_SUCCESS) {
   m_NCS_EDU_PRINT_ERROR_STRING(ederror);
   return rc;


Best Regards,
Thuan

From: Thien Minh Huynh 
mailto:thien.m.hu...@dektech.com.au>>
Sent: Monday, May 11, 2020 2:51 PM
To: Vu Minh Nguyen 
mailto:vu.m.ngu...@dektech.com.au>>; Thuan Tran 
mailto:thuan.t...@dektech.com.au>>
Cc: 
opensaf-devel@lists.sourceforge.net 
mailto:opensaf-devel@lists.sourceforge.net>>
Subject: RE: [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold 
sync [#3183]

Hi Vu,

Thanks for your comments.

Best Regards,
ThienHuynh

-Original Message-
From: Vu Minh Nguyen 
mailto:vu.m.ngu...@dektech.com.au>>
Sent: Monday, May 11, 2020 2:30 PM
To: Thien Minh Huynh 
mailto:thien.m.hu...@dektech.com.au>>; Thuan Tran 
mailto:thuan.t...@dektech.com.au>>
Cc: 
opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold 
sync [#3183]

Ack with minor comments.

On 5/11/20 2:11 PM, thien.m.huynh wrote:
> When NFS is unavailable, client try to write to log. Lgs server will
> put it into the queue with the time. At this time, standby node
> startup and cold sync. Cause of coredump due to duplicate data
> (CkptPushAsync) to put queue is NULL.
> The fix is adding a parametar CkptPushAsync into DecodeColdSync to get
> data for ckpt_proc_push_async more correctly.
[Vu] The description is unclear to me. Here is my suggestion:

The standby logsv is crashed during cold sync if having pending write requests 
in the queue.
That happens because the CkptPushAsync data for decoding is referring to wrong 
data.

The fix is to map the CkptPushAsync to the right memory.


[Vu] The slogan should be updated too.

> ---
>   src/log/logd/lgs_cache.cc | 10 +++---
>   src/log/logd/lgs_cache.h  |  4 ++--
>   src/log/logd/lgs_mbcsv.cc |  6 +-
>   3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
> index e3583e97c..ca25e681c 100644
> --- a/src/log/logd/lgs_cache.cc
> +++ b/src/log/logd/lgs_cache.cc
> @@ -324,8 +324,8 @@ int Cache::EncodeColdSync(NCS_UBAID* uba) const {
>   }
>
>   int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
> -  void* vdata, void** vckpt_rec,
> -  size_t ckpt_rec_size) const {
> +  CkptPushAsync* pasync, void* vdata,
> +  void** vckpt_rec, size_t ckpt_rec_size)
> + const {
> TRACE_ENTER();
> assert(is_active() == false && "This instance does not run with standby 
> role");
> if (lgs_is_peer_v8() == false) return NCSCC_RC_SUCCESS; @@ -344,14
> +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* 
> header,
> uint32_t num_rec = header->num_ckpt_records;
> int rc = NCSCC_RC_SUCCESS;
> EDU_ERR ederror;
> -  lgsv_ckpt_msg_v8_t msg_v8;
> -  auto data = &msg_v8.ckpt_rec.push_async;
> -  CkptPushAsync* cache_data;
> while (num_rec) {
> -cache_data = data;
>   rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
>   uba, EDP_OP_TYPE_DEC,
> -&cache_data, &ederror);
> +&pasync, &ederror);
>   if (rc != NCSCC_RC_SUCCESS) {
> m_NCS_EDU_PRINT_ERROR_STRING(ederror);
> return rc;
> diff --git a/src/log/logd/lgs_cache.h b/src/log/logd/lgs_cache.h index
> a5d6181fb..98ea6791b 100644
> --- a/src/log/logd/lgs_cache.h
> +++ b/src/log/logd/lgs_cache.h
> @@ -251,8 +251,8 @@ class Cache {
> int EncodeColdSync(NCS_UBAID* uba) const;
> // Decode the queue on stanby side.
> int DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
> - v

Re: [devel] [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

2020-05-11 Thread Thuan Tran
Hi Thien,

In my understanding, push_async is vckpt_rec.
I wonder if below idea can solve the issue?

diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
index e3583e97c..27e33702d 100644
--- a/src/log/logd/lgs_cache.cc
+++ b/src/log/logd/lgs_cache.cc
@@ -344,14 +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, 
lgsv_ckpt_header_t* header,
   uint32_t num_rec = header->num_ckpt_records;
   int rc = NCSCC_RC_SUCCESS;
   EDU_ERR ederror;
-  lgsv_ckpt_msg_v8_t msg_v8;
-  auto data = &msg_v8.ckpt_rec.push_async;
-  CkptPushAsync* cache_data;
   while (num_rec) {
-cache_data = data;
 rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
 uba, EDP_OP_TYPE_DEC,
-&cache_data, &ederror);
+vckpt_rec, &ederror);
 if (rc != NCSCC_RC_SUCCESS) {
   m_NCS_EDU_PRINT_ERROR_STRING(ederror);
   return rc;


Best Regards,
Thuan

From: Thien Minh Huynh 
Sent: Monday, May 11, 2020 2:51 PM
To: Vu Minh Nguyen ; Thuan Tran 

Cc: opensaf-devel@lists.sourceforge.net 
Subject: RE: [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold 
sync [#3183]

Hi Vu,

Thanks for your comments.

Best Regards,
ThienHuynh

-Original Message-
From: Vu Minh Nguyen 
Sent: Monday, May 11, 2020 2:30 PM
To: Thien Minh Huynh ; Thuan Tran 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold 
sync [#3183]

Ack with minor comments.

On 5/11/20 2:11 PM, thien.m.huynh wrote:
> When NFS is unavailable, client try to write to log. Lgs server will
> put it into the queue with the time. At this time, standby node
> startup and cold sync. Cause of coredump due to duplicate data
> (CkptPushAsync) to put queue is NULL.
> The fix is adding a parametar CkptPushAsync into DecodeColdSync to get
> data for ckpt_proc_push_async more correctly.
[Vu] The description is unclear to me. Here is my suggestion:

The standby logsv is crashed during cold sync if having pending write requests 
in the queue.
That happens because the CkptPushAsync data for decoding is referring to wrong 
data.

The fix is to map the CkptPushAsync to the right memory.


[Vu] The slogan should be updated too.

> ---
>   src/log/logd/lgs_cache.cc | 10 +++---
>   src/log/logd/lgs_cache.h  |  4 ++--
>   src/log/logd/lgs_mbcsv.cc |  6 +-
>   3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
> index e3583e97c..ca25e681c 100644
> --- a/src/log/logd/lgs_cache.cc
> +++ b/src/log/logd/lgs_cache.cc
> @@ -324,8 +324,8 @@ int Cache::EncodeColdSync(NCS_UBAID* uba) const {
>   }
>
>   int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
> -  void* vdata, void** vckpt_rec,
> -  size_t ckpt_rec_size) const {
> +  CkptPushAsync* pasync, void* vdata,
> +  void** vckpt_rec, size_t ckpt_rec_size)
> + const {
> TRACE_ENTER();
> assert(is_active() == false && "This instance does not run with standby 
> role");
> if (lgs_is_peer_v8() == false) return NCSCC_RC_SUCCESS; @@ -344,14
> +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* 
> header,
> uint32_t num_rec = header->num_ckpt_records;
> int rc = NCSCC_RC_SUCCESS;
> EDU_ERR ederror;
> -  lgsv_ckpt_msg_v8_t msg_v8;
> -  auto data = &msg_v8.ckpt_rec.push_async;
> -  CkptPushAsync* cache_data;
> while (num_rec) {
> -cache_data = data;
>   rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
>   uba, EDP_OP_TYPE_DEC,
> -&cache_data, &ederror);
> +&pasync, &ederror);
>   if (rc != NCSCC_RC_SUCCESS) {
> m_NCS_EDU_PRINT_ERROR_STRING(ederror);
> return rc;
> diff --git a/src/log/logd/lgs_cache.h b/src/log/logd/lgs_cache.h index
> a5d6181fb..98ea6791b 100644
> --- a/src/log/logd/lgs_cache.h
> +++ b/src/log/logd/lgs_cache.h
> @@ -251,8 +251,8 @@ class Cache {
> int EncodeColdSync(NCS_UBAID* uba) const;
> // Decode the queue on stanby side.
> int DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
> - void* vdata, void** vckpt_rec,
> - size_t ckpt_rec_size) const;
> + CkptPushAsync* pasync, void* vdata,
> + void** vckpt_rec, size_t ckpt_rec_size) const;
>
>private:
> // Private constructor to not allow to instantiate this object
> directly, diff --git a/src/log/logd/lgs_mbcsv.cc
> b/src/log/logd/lgs_mbcsv.cc index 6ec004f0a..7d097fc28 100644
> --- a/src/log/logd/lgs_mbcsv.cc
> +++ b/src/log/logd/lgs_mbcsv.cc
> @@ -1677,6 +1677,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
> NCS_MBCSV_CB_ARG *cbk_arg) {
> size_t ckpt_rec_size;
> void *vdata;
> EDU_PROG_HANDLER edp_function_reg = edp_e

Re: [devel] [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

2020-05-11 Thread Thien Minh Huynh
Hi Vu,

Thanks for your comments.

Best Regards,
ThienHuynh

-Original Message-
From: Vu Minh Nguyen  
Sent: Monday, May 11, 2020 2:30 PM
To: Thien Minh Huynh ; Thuan Tran 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold 
sync [#3183]

Ack with minor comments.

On 5/11/20 2:11 PM, thien.m.huynh wrote:
> When NFS is unavailable, client try to write to log. Lgs server will 
> put it into the queue with the time. At this time, standby node 
> startup and cold sync. Cause of coredump due to duplicate data 
> (CkptPushAsync) to put queue is NULL.
> The fix is adding a parametar CkptPushAsync into DecodeColdSync to get 
> data for ckpt_proc_push_async more correctly.
[Vu] The description is unclear to me. Here is my suggestion:

The standby logsv is crashed during cold sync if having pending write requests 
in the queue.
That happens because the CkptPushAsync data for decoding is referring to wrong 
data.

The fix is to map the CkptPushAsync to the right memory.


[Vu] The slogan should be updated too.

> ---
>   src/log/logd/lgs_cache.cc | 10 +++---
>   src/log/logd/lgs_cache.h  |  4 ++--
>   src/log/logd/lgs_mbcsv.cc |  6 +-
>   3 files changed, 10 insertions(+), 10 deletions(-)
>
> diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc 
> index e3583e97c..ca25e681c 100644
> --- a/src/log/logd/lgs_cache.cc
> +++ b/src/log/logd/lgs_cache.cc
> @@ -324,8 +324,8 @@ int Cache::EncodeColdSync(NCS_UBAID* uba) const {
>   }
>   
>   int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
> -  void* vdata, void** vckpt_rec,
> -  size_t ckpt_rec_size) const {
> +  CkptPushAsync* pasync, void* vdata,
> +  void** vckpt_rec, size_t ckpt_rec_size) 
> + const {
> TRACE_ENTER();
> assert(is_active() == false && "This instance does not run with standby 
> role");
> if (lgs_is_peer_v8() == false) return NCSCC_RC_SUCCESS; @@ -344,14 
> +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* 
> header,
> uint32_t num_rec = header->num_ckpt_records;
> int rc = NCSCC_RC_SUCCESS;
> EDU_ERR ederror;
> -  lgsv_ckpt_msg_v8_t msg_v8;
> -  auto data = &msg_v8.ckpt_rec.push_async;
> -  CkptPushAsync* cache_data;
> while (num_rec) {
> -cache_data = data;
>   rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
>   uba, EDP_OP_TYPE_DEC,
> -&cache_data, &ederror);
> +&pasync, &ederror);
>   if (rc != NCSCC_RC_SUCCESS) {
> m_NCS_EDU_PRINT_ERROR_STRING(ederror);
> return rc;
> diff --git a/src/log/logd/lgs_cache.h b/src/log/logd/lgs_cache.h index 
> a5d6181fb..98ea6791b 100644
> --- a/src/log/logd/lgs_cache.h
> +++ b/src/log/logd/lgs_cache.h
> @@ -251,8 +251,8 @@ class Cache {
> int EncodeColdSync(NCS_UBAID* uba) const;
> // Decode the queue on stanby side.
> int DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
> - void* vdata, void** vckpt_rec,
> - size_t ckpt_rec_size) const;
> + CkptPushAsync* pasync, void* vdata,
> + void** vckpt_rec, size_t ckpt_rec_size) const;
>   
>private:
> // Private constructor to not allow to instantiate this object 
> directly, diff --git a/src/log/logd/lgs_mbcsv.cc 
> b/src/log/logd/lgs_mbcsv.cc index 6ec004f0a..7d097fc28 100644
> --- a/src/log/logd/lgs_mbcsv.cc
> +++ b/src/log/logd/lgs_mbcsv.cc
> @@ -1677,6 +1677,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
> NCS_MBCSV_CB_ARG *cbk_arg) {
> size_t ckpt_rec_size;
> void *vdata;
> EDU_PROG_HANDLER edp_function_reg = edp_ed_reg_rec;
> +  CkptPushAsync *pasync{nullptr};
>   
> TRACE_ENTER();
> /*
> @@ -1690,6 +1691,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
> NCS_MBCSV_CB_ARG *cbk_arg) {
>   initialize_client_rec_ptr = &data_v9->ckpt_rec.initialize_client;
>   stream_open_rec_ptr = &data_v9->ckpt_rec.stream_open;
>   vdata = data_v9;
> +pasync = &data_v9->ckpt_rec.push_async;
>   vckpt_rec = &data_v9->ckpt_rec;
>   ckpt_rec_size = sizeof(data_v9->ckpt_rec);
>   edp_function_reg = edp_ed_reg_rec_v6; @@ -1699,6 +1701,7 @@ 
> static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, NCS_MBCSV_CB_ARG 
> *cbk_arg) {
>   initialize_client_rec_ptr = &data_v8->ckpt_rec.initialize_client;
>   stream_open_rec_ptr = &data_v8->ckpt_rec.stream_open;
>   vdata = data_v8;
> +pasync = &data_v8->ckpt_rec.push_async;
>   vckpt_rec = &data_v8->ckpt_rec;
>   ckpt_rec_size = sizeof(data_v8->ckpt_rec);
>   edp_function_reg = edp_ed_reg_rec_v6; @@ -1806,7 +1809,8 @@ 
> static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, NCS_MBCSV_CB_ARG 
> *cbk_arg) {
> } /*End while, stream records */
>   
> rc = Cache::instance()->Decode

Re: [devel] [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

2020-05-11 Thread Nguyen Minh Vu

Ack with minor comments.

On 5/11/20 2:11 PM, thien.m.huynh wrote:

When NFS is unavailable, client try to write to log. Lgs server will put
it into the queue with the time. At this time, standby node startup and
cold sync. Cause of coredump due to duplicate data (CkptPushAsync) to
put queue is NULL.
The fix is adding a parametar CkptPushAsync into DecodeColdSync to get
data for ckpt_proc_push_async more correctly.

[Vu] The description is unclear to me. Here is my suggestion:

The standby logsv is crashed during cold sync if having pending write 
requests in the queue.
That happens because the CkptPushAsync data for decoding is referring to 
wrong data.


The fix is to map the CkptPushAsync to the right memory.


[Vu] The slogan should be updated too.


---
  src/log/logd/lgs_cache.cc | 10 +++---
  src/log/logd/lgs_cache.h  |  4 ++--
  src/log/logd/lgs_mbcsv.cc |  6 +-
  3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
index e3583e97c..ca25e681c 100644
--- a/src/log/logd/lgs_cache.cc
+++ b/src/log/logd/lgs_cache.cc
@@ -324,8 +324,8 @@ int Cache::EncodeColdSync(NCS_UBAID* uba) const {
  }
  
  int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,

-  void* vdata, void** vckpt_rec,
-  size_t ckpt_rec_size) const {
+  CkptPushAsync* pasync, void* vdata,
+  void** vckpt_rec, size_t ckpt_rec_size) const {
TRACE_ENTER();
assert(is_active() == false && "This instance does not run with standby 
role");
if (lgs_is_peer_v8() == false) return NCSCC_RC_SUCCESS;
@@ -344,14 +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, 
lgsv_ckpt_header_t* header,
uint32_t num_rec = header->num_ckpt_records;
int rc = NCSCC_RC_SUCCESS;
EDU_ERR ederror;
-  lgsv_ckpt_msg_v8_t msg_v8;
-  auto data = &msg_v8.ckpt_rec.push_async;
-  CkptPushAsync* cache_data;
while (num_rec) {
-cache_data = data;
  rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
  uba, EDP_OP_TYPE_DEC,
-&cache_data, &ederror);
+&pasync, &ederror);
  if (rc != NCSCC_RC_SUCCESS) {
m_NCS_EDU_PRINT_ERROR_STRING(ederror);
return rc;
diff --git a/src/log/logd/lgs_cache.h b/src/log/logd/lgs_cache.h
index a5d6181fb..98ea6791b 100644
--- a/src/log/logd/lgs_cache.h
+++ b/src/log/logd/lgs_cache.h
@@ -251,8 +251,8 @@ class Cache {
int EncodeColdSync(NCS_UBAID* uba) const;
// Decode the queue on stanby side.
int DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
- void* vdata, void** vckpt_rec,
- size_t ckpt_rec_size) const;
+ CkptPushAsync* pasync, void* vdata,
+ void** vckpt_rec, size_t ckpt_rec_size) const;
  
   private:

// Private constructor to not allow to instantiate this object directly,
diff --git a/src/log/logd/lgs_mbcsv.cc b/src/log/logd/lgs_mbcsv.cc
index 6ec004f0a..7d097fc28 100644
--- a/src/log/logd/lgs_mbcsv.cc
+++ b/src/log/logd/lgs_mbcsv.cc
@@ -1677,6 +1677,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
size_t ckpt_rec_size;
void *vdata;
EDU_PROG_HANDLER edp_function_reg = edp_ed_reg_rec;
+  CkptPushAsync *pasync{nullptr};
  
TRACE_ENTER();

/*
@@ -1690,6 +1691,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
  initialize_client_rec_ptr = &data_v9->ckpt_rec.initialize_client;
  stream_open_rec_ptr = &data_v9->ckpt_rec.stream_open;
  vdata = data_v9;
+pasync = &data_v9->ckpt_rec.push_async;
  vckpt_rec = &data_v9->ckpt_rec;
  ckpt_rec_size = sizeof(data_v9->ckpt_rec);
  edp_function_reg = edp_ed_reg_rec_v6;
@@ -1699,6 +1701,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
  initialize_client_rec_ptr = &data_v8->ckpt_rec.initialize_client;
  stream_open_rec_ptr = &data_v8->ckpt_rec.stream_open;
  vdata = data_v8;
+pasync = &data_v8->ckpt_rec.push_async;
  vckpt_rec = &data_v8->ckpt_rec;
  ckpt_rec_size = sizeof(data_v8->ckpt_rec);
  edp_function_reg = edp_ed_reg_rec_v6;
@@ -1806,7 +1809,8 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
} /*End while, stream records */
  
rc = Cache::instance()->DecodeColdSync(&cbk_arg->info.decode.i_uba, header,

- vdata, &vckpt_rec, ckpt_rec_size);
+ pasync, vdata, &vckpt_rec,
+ ckpt_rec_size);
if (rc != NCSCC_RC_SUCCESS) {
  LOG_NO("DecodeColdSync failed");
  goto done;




___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-deve

[devel] [PATCH 0/1] Review Request for lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

2020-05-11 Thread thien.m.huynh
Summary: lgs: fix data CkptPushAsync equals with encode cold sync [#3183]
Review request for Ticket(s): 3183
Peer Reviewer(s): Vu, Thuan
Pull request to: Thuan
Affected branch(es): develop
Development branch: ticket-3183
Base revision: b2497e28ef679c4d210955b058f710c1c6954220
Personal repository: git://git.code.sf.net/u/thienhuynh/review


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 5d158572dffc0cbef16ffea32ce532527d36e974
Author: thien.m.huynh 
Date:   Mon, 11 May 2020 14:06:42 +0700

lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

When NFS is unavailable, client try to write to log. Lgs server will put
it into the queue with the time. At this time, standby node startup and
cold sync. Cause of coredump due to duplicate data (CkptPushAsync) to
put queue is NULL.

The fix is adding a parametar CkptPushAsync into DecodeColdSync to get
data for ckpt_proc_push_async more correctly.



Complete diffstat:
--
 src/log/logd/lgs_cache.cc | 10 +++---
 src/log/logd/lgs_cache.h  |  4 ++--
 src/log/logd/lgs_mbcsv.cc |  6 +-
 3 files changed, 10 insertions(+), 10 deletions(-)


Testing Commands:
-
N/A

Testing, Expected Results:
--
N/A

Conditions of Submission:
-
ACK from reviewers

Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.gitconfig file (i.e. user.name, user.email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] lgs: fix data CkptPushAsync equals with encode cold sync [#3183]

2020-05-11 Thread thien.m.huynh
When NFS is unavailable, client try to write to log. Lgs server will put
it into the queue with the time. At this time, standby node startup and
cold sync. Cause of coredump due to duplicate data (CkptPushAsync) to
put queue is NULL.

The fix is adding a parametar CkptPushAsync into DecodeColdSync to get
data for ckpt_proc_push_async more correctly.
---
 src/log/logd/lgs_cache.cc | 10 +++---
 src/log/logd/lgs_cache.h  |  4 ++--
 src/log/logd/lgs_mbcsv.cc |  6 +-
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/log/logd/lgs_cache.cc b/src/log/logd/lgs_cache.cc
index e3583e97c..ca25e681c 100644
--- a/src/log/logd/lgs_cache.cc
+++ b/src/log/logd/lgs_cache.cc
@@ -324,8 +324,8 @@ int Cache::EncodeColdSync(NCS_UBAID* uba) const {
 }
 
 int Cache::DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
-  void* vdata, void** vckpt_rec,
-  size_t ckpt_rec_size) const {
+  CkptPushAsync* pasync, void* vdata,
+  void** vckpt_rec, size_t ckpt_rec_size) const {
   TRACE_ENTER();
   assert(is_active() == false && "This instance does not run with standby 
role");
   if (lgs_is_peer_v8() == false) return NCSCC_RC_SUCCESS;
@@ -344,14 +344,10 @@ int Cache::DecodeColdSync(NCS_UBAID* uba, 
lgsv_ckpt_header_t* header,
   uint32_t num_rec = header->num_ckpt_records;
   int rc = NCSCC_RC_SUCCESS;
   EDU_ERR ederror;
-  lgsv_ckpt_msg_v8_t msg_v8;
-  auto data = &msg_v8.ckpt_rec.push_async;
-  CkptPushAsync* cache_data;
   while (num_rec) {
-cache_data = data;
 rc = m_NCS_EDU_EXEC(&lgs_cb->edu_hdl, EncodeDecodePushAsync,
 uba, EDP_OP_TYPE_DEC,
-&cache_data, &ederror);
+&pasync, &ederror);
 if (rc != NCSCC_RC_SUCCESS) {
   m_NCS_EDU_PRINT_ERROR_STRING(ederror);
   return rc;
diff --git a/src/log/logd/lgs_cache.h b/src/log/logd/lgs_cache.h
index a5d6181fb..98ea6791b 100644
--- a/src/log/logd/lgs_cache.h
+++ b/src/log/logd/lgs_cache.h
@@ -251,8 +251,8 @@ class Cache {
   int EncodeColdSync(NCS_UBAID* uba) const;
   // Decode the queue on stanby side.
   int DecodeColdSync(NCS_UBAID* uba, lgsv_ckpt_header_t* header,
- void* vdata, void** vckpt_rec,
- size_t ckpt_rec_size) const;
+ CkptPushAsync* pasync, void* vdata,
+ void** vckpt_rec, size_t ckpt_rec_size) const;
 
  private:
   // Private constructor to not allow to instantiate this object directly,
diff --git a/src/log/logd/lgs_mbcsv.cc b/src/log/logd/lgs_mbcsv.cc
index 6ec004f0a..7d097fc28 100644
--- a/src/log/logd/lgs_mbcsv.cc
+++ b/src/log/logd/lgs_mbcsv.cc
@@ -1677,6 +1677,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
   size_t ckpt_rec_size;
   void *vdata;
   EDU_PROG_HANDLER edp_function_reg = edp_ed_reg_rec;
+  CkptPushAsync *pasync{nullptr};
 
   TRACE_ENTER();
   /*
@@ -1690,6 +1691,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
 initialize_client_rec_ptr = &data_v9->ckpt_rec.initialize_client;
 stream_open_rec_ptr = &data_v9->ckpt_rec.stream_open;
 vdata = data_v9;
+pasync = &data_v9->ckpt_rec.push_async;
 vckpt_rec = &data_v9->ckpt_rec;
 ckpt_rec_size = sizeof(data_v9->ckpt_rec);
 edp_function_reg = edp_ed_reg_rec_v6;
@@ -1699,6 +1701,7 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
 initialize_client_rec_ptr = &data_v8->ckpt_rec.initialize_client;
 stream_open_rec_ptr = &data_v8->ckpt_rec.stream_open;
 vdata = data_v8;
+pasync = &data_v8->ckpt_rec.push_async;
 vckpt_rec = &data_v8->ckpt_rec;
 ckpt_rec_size = sizeof(data_v8->ckpt_rec);
 edp_function_reg = edp_ed_reg_rec_v6;
@@ -1806,7 +1809,8 @@ static uint32_t ckpt_decode_cold_sync(lgs_cb_t *cb, 
NCS_MBCSV_CB_ARG *cbk_arg) {
   } /*End while, stream records */
 
   rc = Cache::instance()->DecodeColdSync(&cbk_arg->info.decode.i_uba, header,
- vdata, &vckpt_rec, ckpt_rec_size);
+ pasync, vdata, &vckpt_rec,
+ ckpt_rec_size);
   if (rc != NCSCC_RC_SUCCESS) {
 LOG_NO("DecodeColdSync failed");
 goto done;
-- 
2.17.1



___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel