bloomberg / bloomberg/comdb2

Why heartbeat_check_time in lrl file has no expected effect?

Open
#423 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C
Stars
1.5k
Forks
243
Avg merge
2d 2h
Merged PRs (30d)
37

Description

I want to do some debugging in cluster setting, after some struggling my docker cluster and my IDE comdb2 instance are in the same subnet and they elects a master, I copied data files from the IDE instance and I started IDE instance first and every time it is the master.
When started the IDE comdb2 instance in no-debug mode everything works perfectly.

When I start the IDE comdb2 instance in debug mode, after the query hits the breakpoint and I stay in source code for a while I see the error message saying that "no data in 11 seconds, killing session", so I check the source code to see where this message comes from. I see this message comes from net.c and it is because there is no heart beat messge within 10 seconds.
I set "heartbeat_check_time 3000" in testdb.lrl but the master behaves the same. I debug to make sure the value has been set and it is set to gbl_heartbeat_check.

I searched the source code and found that:
function net_set_heartbeat_check_time()
1.called by dbenv_open() in file.c

net_set_heartbeat_check_time(bdb_state->repinfo->netinfo, 60);
/* expect heartbeats from every node every 5 seconds */
net_set_heartbeat_check_time(bdb_state->repinfo->netinfo, 10);
**----it is hard coded as 10 seconds, is it a bug?**

2. called by init() in comdb2.c

if (gbl_heartbeat_check) {
net_set_heartbeat_check_time(thedb->handle_sibling,
gbl_heartbeat_check);
}
if (gbl_heartbeat_send_signal) {
net_set_heartbeat_send_time(thedb->handle_sibling_signal,
gbl_heartbeat_send_signal);
}
if (gbl_heartbeat_check_signal) {
net_set_heartbeat_check_time(thedb->handle_sibling_signal,
gbl_heartbeat_check_signal);
}

3.called osql_comm_init in osql_comm.c

/* set the heartbit for the offload network */
if (gbl_heartbeat_check)
net_set_heartbeat_check_time(tmp->handle_sibling, gbl_heartbeat_check);

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.