-
Bug
-
Resolution: Not a Bug
-
Medium
-
Jakarta Release
-
ONAP Jakarta
Hi, I've checked the process of switching over between ACTIVE and NON-active processes and it doesn't work.
After default installation of Heartbeat MS in my pod I see 4 processes:
python3 -u misshtbtd.py -v
For example their PIDs are: 7, 10, 14, 16.
The first one with PID 7 is active and hb_common table is populated about it:
process_id | source_name | last_accessed_time | current_state
----------{}+{}-------------{}{}----------------{}{}-------------
7 | dcae-heartbeat- | 1663608587 | RUNNING
If I kill this process I expect the main process to switch over to another one and table hb_common should be updated.
In logs I see the following:
2022-09-16 12:07:04,428 | {}main{} | misshtbtd | main | 359 | INFO | ('MSHBT: hb_common values ', 7, 'RUNNING', 'dcae-heartbeat-', 1663329631)
2022-09-16 12:07:04,428 | {}main{} | misshtbtd | main | 363 | INFO | ('MSHBD:pid,srcName,state,time,ctime,timeDiff is', 7, 'dcae-heartbeat-', 'RUNNING', 1663329631, 1663330024, 393)
2022-09-16 12:07:04,428 | {}main{} | misshtbtd | main | 406 | INFO | MSHBD:Active instance is inactive for long time: Time to switchover
2022-09-16 12:07:04,428 | {}main{} | misshtbtd | main | 408 | INFO | MSHBD:Initiating to become Active Instance
2022-09-16 12:07:04,428 | {}main{} | misshtbtd | main | 410 | INFO | MSHBD:HB and DBM thread are waiting to become ACTIVE
2022-09-16 12:07:04,442 | {}main{} | misshtbtd | create_update_hb_common | 121 | INFO | MSHBT:Updated hb_common DB with new values
2022-09-16 12:07:09,596 | {}main{} | db_monitoring | db_monitoring | 228 | INFO | DBM:Inactive instance or hb_common state is not RUNNING
So as I see the main process is going to update hb_common to switch to another PID. But it never happens.
Looking at code I see that this 'process_id' column is never updated in the table! - file misshtbtd.py has following procedure:
elif update_flg == 1:
cur.execute(
"UPDATE hb_common SET LAST_ACCESSED_TIME = %s, CURRENT_STATE = %s "
"WHERE PROCESS_ID = %s AND SOURCE_NAME = %s",
(current_time, state, process_id, source_name),
)
_logger.info("MSHBT:Updated hb_common DB with new values")
So as you may see it updates only last_accessed_time and current_state columns.
- blocks
-
DCAEGEN2-267 Heartbeat Microservice Support
- Closed