mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-28 01:16:29 +00:00
"repmgr cluster crosscheck": add --csv output
As advertised.
This commit is contained in:
@@ -623,7 +623,33 @@ do_cluster_crosscheck(void)
|
||||
t_node_status_cube **cube;
|
||||
|
||||
n = build_cluster_crosscheck(&cube, &name_length);
|
||||
if (runtime_options.output_mode == OM_CSV)
|
||||
{
|
||||
for (i = 0; i < n; i++)
|
||||
{
|
||||
int j;
|
||||
for (j = 0; j < n; j++)
|
||||
{
|
||||
int max_node_status = -2;
|
||||
int node_ix = 0;
|
||||
|
||||
for (node_ix = 0; node_ix < n; node_ix++)
|
||||
{
|
||||
int node_status = cube[node_ix]->matrix_list_rec[i]->node_status_list[j]->node_status;
|
||||
|
||||
if (node_status > max_node_status)
|
||||
max_node_status = node_status;
|
||||
}
|
||||
printf("%i,%i,%i\n",
|
||||
cube[i]->node_id,
|
||||
cube[j]->node_id,
|
||||
max_node_status);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
printf("%*s | Id ", name_length, node_header);
|
||||
for (i = 0; i < n; i++)
|
||||
printf("| %2d ", cube[i]->node_id);
|
||||
@@ -691,6 +717,7 @@ do_cluster_crosscheck(void)
|
||||
|
||||
printf("\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* clean up allocated cube array */
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user