fix bug for primary and backup master heartbeat

need be careful about the protobuf decoder