Skip to content

Commit

Permalink
Increment retries when applicable in sync scans.
Browse files Browse the repository at this point in the history
Reserve nodes whenever writing cluster metrics.
  • Loading branch information
BrianNichols committed Feb 27, 2024
1 parent 082a088 commit 7e1a304
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/main/aerospike/aerospike_scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,10 @@ as_scan_partitions(
}

uint32_t n_nodes = pt->node_parts.size;

if (pt->iteration > 1) {
as_cluster_add_retries(cluster, n_nodes);
}

// Initialize task.
uint32_t error_mutex = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/main/aerospike/as_metrics_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ as_metrics_write_cluster(as_error* err, as_metrics_writer* mw, as_cluster* clust
}
as_string_builder_append(&sb, "],[");

// Since this function is only called from the cluster tend thread, there is no need to reserve nodes.
as_nodes* nodes = cluster->nodes;
as_nodes* nodes = as_nodes_reserve(cluster);

for (uint32_t i = 0; i < nodes->size; i++) {
as_node* node = nodes->array[i];

Expand All @@ -553,6 +553,7 @@ as_metrics_write_cluster(as_error* err, as_metrics_writer* mw, as_cluster* clust
}
as_metrics_write_node(mw, &sb, node);
}
as_nodes_release(nodes);
as_string_builder_append(&sb, "]]");

as_string_builder_append_newline(&sb);
Expand Down

0 comments on commit 7e1a304

Please sign in to comment.