Hi Vu, ACK, Add TRACE`s in error return cases
-AVM On 8/23/2016 3:29 PM, Vu Minh Nguyen wrote: > Hi Mahesh, > > Seems "/var/log/opensaf/saflog" not shared folder? > > To check that, create something (e.g: a file ) in that folder, and check > whether that file > can be seen by all nodes. > > To pass the test, the log folder has to be seen by all nodes. > > Regards, Vu > >> -----Original Message----- >> From: A V Mahesh [mailto:mahesh.va...@oracle.com] >> Sent: Tuesday, August 23, 2016 4:04 PM >> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'Lennart Lund' >> <lennart.l...@ericsson.com> >> Cc: opensaf-devel@lists.sourceforge.net >> Subject: Re: [devel] [PATCH 1 of 1] log: fix failed to recover app streams >> [#1941] >> >> Hi Vu, >> >> In case logRootDirectory is /var/log/opensaf/saflog , >> and it is available , still getting problem. >> >> ************************************************************** >> ************************** >> PL-3:/var/log/opensaf/saflog # /usr/bin/logtest -e 9 >> >> Suite 9: LOG Server down / up >> ; >> Preparing 8 streams for test. Please wait... >> Preparing stream 0 >> ....................... >> Preparing stream 1 >> ....................... >> cur_logfile_name_get scandir Fail No such file or >> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed >> 2 FAILED (expected EXIT_SUCCESS, got EXIT_FAILURE >> (1))PL-3:/var/log/opensaf/saflog # /usr/bin/logtest -e 9 >> >> Suite 9: LOG Server down / up >> ; >> Preparing 8 streams for test. Please wait... >> Preparing stream 0 >> ....................... >> Preparing stream 1 >> ....................... >> cur_logfile_name_get scandir Fail No such file or >> directorysaLogRecov_prepare_client1_8streams Internal error. Test failed >> 2 FAILED (expected EXIT_SUCCESS, got EXIT_FAILURE >> (1))PL-3:/var/log/opensaf/saflog # pwd >> /var/log/opensaf/saflog >> PL-3:/var/log/opensaf/saflog # ls >> PL-3:/var/log/opensaf/saflog # immlist logConfig=1,safApp=safLogService >> Name Type Value(s) >> ============================================================== >> ========== >> logStreamSystemLowLimit SA_UINT32_T 0 (0x0) >> logStreamSystemHighLimit SA_UINT32_T 0 (0x0) >> logStreamFileFormat SA_STRING_T <Empty> >> logStreamAppLowLimit SA_UINT32_T 0 (0x0) >> logStreamAppHighLimit SA_UINT32_T 0 (0x0) >> logRootDirectory SA_STRING_T >> /var/log/opensaf/saflog >> logMaxLogrecsize SA_UINT32_T 1024 > (0x400) >> logMaxApplicationStreams SA_UINT32_T 64 (0x40) >> logFileSysConfig SA_UINT32_T 1 (0x1) >> logFileIoTimeout SA_UINT32_T 500 > (0x1f4) >> logDataGroupname SA_STRING_T <Empty> >> logConfig SA_STRING_T logConfig=1 >> SaImmAttrImplementerName SA_STRING_T >> safLogService >> SaImmAttrClassName SA_STRING_T >> OpenSafLogConfig >> SaImmAttrAdminOwnerName SA_STRING_T IMMLOADER >> ************************************************************** >> ************************** >> >> >> -AVM >> >> On 8/23/2016 12:50 PM, Vu Minh Nguyen wrote: >>> Hi Mahesh, >>> >>> The folder "/repl_opensaf/saflog/logtest_sc_down_path/" is on UML >> container. >>> I guess, on your system, the path is different. >>> >>> To get the correct patch to shared log folder, do following: >>> >>> 1) Get the log root folder: >>> # immlist logConfig=1,safApp=safLogService >>> Name Type Value(s) >>> >> ============================================================== >> ========== >>> logRootDirectory SA_STRING_T >>> /repl_opensaf/saflog >>> >>> >>> 2) On PL, check if the node can access to shared folder: >>> <logRootDirectory>/logtest_sc_down_path >>> >>> >>> Regards, Vu >>> >>>> -----Original Message----- >>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com] >>>> Sent: Tuesday, August 23, 2016 1:59 PM >>>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'Lennart Lund' >>>> <lennart.l...@ericsson.com> >>>> Cc: opensaf-devel@lists.sourceforge.net >>>> Subject: Re: [devel] [PATCH 1 of 1] log: fix failed to recover app > streams >>>> [#1941] >>>> >>>> Hi Vu, >>>> >>>> This folder doesn't exist , i just created on PL-3 , still failing >>>> >>>> PL-3:~ # mkdir -p /repl_opensaf/saflog/logtest_sc_down_path/ >>>> PL-3:~ # >>>> >>>> PL-3:~ # /usr/bin/logtest -e 9 >>>> >>>> Suite 9: LOG Server down / up >>>> ; >>>> Preparing 8 streams for test. Please wait... >>>> Preparing stream 0 >>>> ....................... >>>> Preparing stream 1 >>>> ....................... >>>> cur_logfile_name_get scandir Fail No such file or >>>> directorysaLogRecov_prepare_client1_8streams Internal error. Test > failed >>>> 2 FAILED (expected EXIT_SUCCESS, got EXIT_FAILURE (1))PL-3:~ # >>>> >>>> -AVM >>>> >>>> >>>> On 8/23/2016 12:21 PM, Vu Minh Nguyen wrote: >>>>> Hi Mahesh, >>>>> >>>>> Can you check if PL node can access the shared log folder? >>>>> >>>>> E.g: path on UML test >>>>> /repl_opensaf/saflog/logtest_sc_down_path/ >>>>> >>>>> I guess the problem is caused by PL not able to access the SAF log >>> folder. >>>>> Regards, Vu >>>>> >>>>>> -----Original Message----- >>>>>> From: A V Mahesh [mailto:mahesh.va...@oracle.com] >>>>>> Sent: Tuesday, August 23, 2016 1:46 PM >>>>>> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; Lennart Lund >>>>>> <lennart.l...@ericsson.com> >>>>>> Cc: opensaf-devel@lists.sourceforge.net >>>>>> Subject: Re: [devel] [PATCH 1 of 1] log: fix failed to recover app >>> streams >>>>>> [#1941] >>>>>> >>>>>> Hi Vu, >>>>>> >>>>>> I got it running on SC , but it is failing on PL with : >>>>>> >>>>>> "cur_logfile_name_get scandir Fail No such file or >>>>>> directorysaLogRecov_prepare_client1_8streams Internal error. Test >>> failed >>>>>> 2 FAILED (expected EXIT_SUCCESS, got EXIT_FAILURE (1))" >>>>>> >>>>>> -AVM >>>>>> >>>>>> >>>>>> On 8/23/2016 12:06 PM, A V Mahesh wrote: >>>>>>> Hi Vu, >>>>>>> >>>>>>> Why test case is allowed on SC`s ? >>>>>>> >>>>>>> >> ============================================================== >>>>>> ============ >>>>>>> SC-1:~ # /usr/bin/logtest -e 9 >>>>>>> >>>>>>> Suite 9: LOG Server down / up >>>>>>> ; >>>>>>> Preparing 8 streams for test. Please wait... >>>>>>> Preparing stream 0 >>>>>>> ....................... >>>>>>> Preparing stream 1 >>>>>>> ....................... >>>>>>> Preparing stream 2 >>>>>>> ....................... >>>>>>> Preparing stream 3 >>>>>>> .. >>>>>>> Preparing stream 4 >>>>>>> .. >>>>>>> Preparing stream 5 >>>>>>> . >>>>>>> Preparing stream 6 >>>>>>> Preparing stream 7 >>>>>>> 2 PASSED Before SC down: Prepare 8 streams; >>>>>>> Preparing 1 config stream (notification) for test . Please wait... >>>>>>> . >>>>>>> 3 PASSED Before SC down: Prepare 1 cfg (notif) stream; >>>>>>> >>>>>>> Stop both SC nodes [stdby first]. Press Enter when stopped... >>>>>>> ; >>>>>>> >>>>>>> Start at least one SC node. Press Enter when started... >>>>>>> >>>>>>> >> ============================================================== >>>>>> ============ >>>>>>> -AVM >>>>>>> >>>>>>> On 8/23/2016 12:03 PM, A V Mahesh wrote: >>>>>>>> Hi Vu, >>>>>>>> >>>>>>>> test case 9 failing on PL-3 , i am i missing any configuration ? >>>>>>>> >>>>>>>> # /usr/bin/logtest -e 9 >>>>>>>> >>>>>>>> Suite 9: LOG Server down / up >>>>>>>> ; >>>>>>>> Preparing 8 streams for test. Please wait... >>>>>>>> Preparing stream 0 >>>>>>>> ....................... >>>>>>>> Preparing stream 1 >>>>>>>> ....................... >>>>>>>> cur_logfile_name_get scandir Fail No such file or >>>>>>>> directorysaLogRecov_prepare_client1_8streams Internal error. Test >>>>> failed >>>>>>>> -AVM >>>>>>>> >>>>>>>> On 8/10/2016 12:09 PM, Vu Minh Nguyen wrote: >>>>>>>>> osaf/services/saf/logsv/lgs/lgs_recov.cc | 59 >>>>> +++++++++++++++++---- >>>>>> ---------- >>>>>>>>> 1 files changed, 32 insertions(+), 27 deletions(-) >>>>>>>>> >>>>>>>>> >>>>>>>>> create_new_app_stream() was changed and introduced new error >>>> codes >>>>>> in long DN >>>>>>>>> ticket. One of them is SA_AIS_ERR_EXIST. >>>>>>>>> >>>>>>>>> When SCs restart from headless, create_new_app_stream() returns >>>>>> SA_AIS_ERR_EXIST >>>>>>>>> but this error code was not handled correctly and made recovery >>>>>> functionality >>>>>>>>> fail. >>>>>>>>> >>>>>>>>> lgs_restore_one_app_stream needs to be updated. >>>>>>>>> >>>>>>>>> diff --git a/osaf/services/saf/logsv/lgs/lgs_recov.cc >>>>>> b/osaf/services/saf/logsv/lgs/lgs_recov.cc >>>>>>>>> --- a/osaf/services/saf/logsv/lgs/lgs_recov.cc >>>>>>>>> +++ b/osaf/services/saf/logsv/lgs/lgs_recov.cc >>>>>>>>> @@ -309,24 +309,6 @@ static int lgs_get_file_params_h(gfp_in_ >>>>>>>>> return rc; >>>>>>>>> } >>>>>>>>> >>>>>>>>> -static void lgs_remove_stream(uint32_t client_id, log_stream_t >>>>>> *log_stream) >>>>>>>>> -{ >>>>>>>>> - TRACE_ENTER(); >>>>>>>>> - >>>>>>>>> - /* Remove the stream handle and >>>>>>>>> - * remove the stream resources >>>>>>>>> - */ >>>>>>>>> - if (lgs_client_stream_rmv(client_id, log_stream->streamId) > < >>>>> 0) { >>>>>>>>> - TRACE("%s lgs_client_stream_rmv Fail", >> __FUNCTION__); >>>>>>>>> - } >>>>>>>>> - >>>>>>>>> - log_free_stream_resources(log_stream); >>>>>>>>> - >>>>>>>>> - log_stream = NULL; >>>>>>>>> - >>>>>>>>> - TRACE_LEAVE(); >>>>>>>>> -} >>>>>>>>> - >>>>>>>>> /** >>>>>>>>> * Restore parameters for a lost runtime (application) > stream, >>>>> create >>>>>> the >>>>>>>>> * stream in the local stream list and associate with a > client. >>>>>>>>> @@ -344,7 +326,6 @@ int lgs_restore_one_app_stream( >>>>>>>>> { >>>>>>>>> int int_rc = 0; >>>>>>>>> int rc_out = 0; >>>>>>>>> - SaAisErrorT ais_rc = SA_AIS_OK; >>>>>>>>> SaImmHandleT immOmHandle; >>>>>>>>> SaImmAttrValuesT_2 *attribute; >>>>>>>>> SaImmAttrValuesT_2 **attributes; >>>>>>>>> @@ -353,7 +334,7 @@ int lgs_restore_one_app_stream( >>>>>>>>> int list_pos; >>>>>>>>> int n; >>>>>>>>> int i = 0; >>>>>>>>> - >>>>>>>>> + SaBoolT twelveHourModeFlag = SA_FALSE; >>>>>>>>> lgsv_stream_open_req_t open_stream_param; >>>>>>>>> log_stream_t *log_stream = NULL; >>>>>>>>> SaTimeT restored_creationTimeStamp = 0; >>>>>>>>> @@ -552,23 +533,46 @@ int lgs_restore_one_app_stream( >>>>>>>>> */ >>>>>>>>> open_stream_param.client_id = client_id; >>>>>>>>> open_stream_param.lstr_open_flags = 0; /* Dummy not >>>> used >>>>> here >>>>>> */ >>>>>>>>> - >>>>>>>>> open_stream_param.logFileName = const_cast<char >>>>>> *>(fileName.c_str()); >>>>>>>>> open_stream_param.logFilePathName = const_cast<char >>>>>> *>(pathName.c_str()); >>>>>>>>> - ais_rc = create_new_app_stream(&open_stream_param, >>>>>> &log_stream); >>>>>>>>> - if ( ais_rc != SA_AIS_OK) { >>>>>>>>> - TRACE("%s: create_new_app_stream Fail %s", >>>>>>>>> - __FUNCTION__, saf_error(ais_rc)); >>>>>>>>> + log_stream = log_stream_new(stream_name, >>>> STREAM_NEW); >>>>>>>>> + if (log_stream == NULL) { >>>>>>>>> rc_out = -1; >>>>>>>>> goto done_free_attr; >>>>>>>>> } >>>>>>>>> >>>>>>>>> + /** >>>>>>>>> + * No need to verify all attributes as >>>>>>>>> + * they have been verified at the time of creation >>>>>>>>> + */ >>>>>>>>> + >>>>>>>>> + /* Get twelveHourModeFlag from the logFileFmt */ >>>>>>>>> + >>>> lgs_is_valid_format_expression(open_stream_param.logFileFmt, >>>>>>>>> + STREAM_TYPE_APPLICATION, >>>>>>>>> + &twelveHourModeFlag); >>>>>>>>> + rc_out = lgs_populate_log_stream( >>>>>>>>> + open_stream_param.logFileName, >>>>>>>>> + open_stream_param.logFilePathName, >>>>>>>>> + open_stream_param.maxLogFileSize, >>>>>>>>> + open_stream_param.maxLogRecordSize, >>>>>>>>> + open_stream_param.logFileFullAction, >>>>>>>>> + open_stream_param.maxFilesRotated, >>>>>>>>> + open_stream_param.logFileFmt, >>>>>>>>> + STREAM_TYPE_APPLICATION, >>>>>>>>> + twelveHourModeFlag, >>>>>>>>> + 0, >>>>>>>>> + log_stream); // output >>>>>>>>> + if (rc_out == -1) { >>>>>>>>> + log_stream_delete(&log_stream); >>>>>>>>> + goto done_free_attr; >>>>>>>>> + } >>>>>>>>> + >>>>>>>>> /* Create an association between this client and the > stream >>>>> */ >>>>>>>>> int_rc = lgs_client_stream_add(client_id, >>>>> log_stream->streamId); >>>>>>>>> if (int_rc == -1) { >>>>>>>>> TRACE("%s: lgs_client_stream_add Fail", >>>>> __FUNCTION__); >>>>>>>>> - log_free_stream_resources(log_stream); /* Undo >>> create >>>>>> new stream */ >>>>>>>>> + log_stream_delete(&log_stream); >>>>>>>>> rc_out = -1; >>>>>>>>> goto done_free_attr; >>>>>>>>> } >>>>>>>>> @@ -606,7 +610,8 @@ int lgs_restore_one_app_stream( >>>>>>>>> /* Remove the stream handle and >>>>>>>>> * remove the stream resources >>>>>>>>> */ >>>>>>>>> - lgs_remove_stream(client_id, log_stream); >>>>>>>>> + lgs_client_stream_rmv(client_id, log_stream- >>>>> streamId); >>>>>>>>> + log_stream_delete(&log_stream); >>>>>>>>> rc_out = -1; >>>>>>>>> goto done_free_attr; >>>>>>>>> } > ---------------------------------------------------------------------------- >>>>> -- >>>>>>>> _______________________________________________ >>>>>>>> Opensaf-devel mailing list >>>>>>>> Opensaf-devel@lists.sourceforge.net >>>>>>>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel > ---------------------------------------------------------------------------- >>>>> -- >>>>>>> _______________________________________________ >>>>>>> Opensaf-devel mailing list >>>>>>> Opensaf-devel@lists.sourceforge.net >>>>>>> https://lists.sourceforge.net/lists/listinfo/opensaf-devel > ------------------------------------------------------------------------------ _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel