Skip to content

Commit

Permalink
Merge branch 'main' into 4973-new-monitor-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
dlmarion committed Jan 3, 2025
2 parents 7881de1 + be70c2a commit c098e89
Show file tree
Hide file tree
Showing 24 changed files with 256 additions and 199 deletions.
331 changes: 193 additions & 138 deletions assemble/bin/accumulo-cluster

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions assemble/bin/accumulo-service
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ function rotate_log() {

function get_group() {
# Find the group parameter if any
GROUP_PATTERN="^(compactor.group|sserver.group|tserver.group)=(.*)$"
group="default"
local group="default"
local param
for param in "$@"; do
if [[ $param =~ $GROUP_PATTERN ]]; then
group="${BASH_REMATCH[2]}"
if [[ $param =~ ^[a-z]*[.]group=(.*)$ ]]; then
group="${BASH_REMATCH[1]}"
fi
done
echo "${group}"
echo "$group"
}

function start_service() {
Expand Down Expand Up @@ -111,7 +111,7 @@ function start_service() {
rotate_log "$outfile"
rotate_log "$errfile"

nohup "${bin}/accumulo" "$service_type" "$@" "${PROPERTY_OVERRIDES[@]}" >"$outfile" 2>"$errfile" </dev/null &
nohup "${bin}/accumulo" "$service_type" "$@" >"$outfile" 2>"$errfile" </dev/null &
echo "$!" >"${pid_file}"

done
Expand Down
2 changes: 1 addition & 1 deletion assemble/conf/accumulo-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ case "${ACCUMULO_RESOURCE_GROUP:-default}" in
esac
;;
*)
echo "ACCUMULO_RESOURCE_GROUP named $ACCUMULO_RESOURCE_GROUP is not configured"
echo "ACCUMULO_RESOURCE_GROUP named $ACCUMULO_RESOURCE_GROUP is not configured in accumulo-env.sh"
exit 1
;;
esac
Expand Down
29 changes: 1 addition & 28 deletions core/src/main/java/org/apache/accumulo/core/conf/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public enum Property {
MANAGER_FATE_METRICS_MIN_UPDATE_INTERVAL("manager.fate.metrics.min.update.interval", "60s",
PropertyType.TIMEDURATION, "Limit calls from metric sinks to zookeeper to update interval.",
"1.9.3"),
MANAGER_FATE_THREADPOOL_SIZE("manager.fate.threadpool.size", "4", PropertyType.COUNT,
MANAGER_FATE_THREADPOOL_SIZE("manager.fate.threadpool.size", "64", PropertyType.COUNT,
"The number of threads used to run fault-tolerant executions (FATE)."
+ " These are primarily table operations like merge.",
"1.4.3"),
Expand Down Expand Up @@ -480,57 +480,44 @@ public enum Property {
+ " as un-splittable.",
"3.1.0"),
// properties that are specific to scan server behavior
@Experimental
SSERV_PREFIX("sserver.", null, PropertyType.PREFIX,
"Properties in this category affect the behavior of the scan servers.", "2.1.0"),
@Experimental
SSERV_DATACACHE_SIZE("sserver.cache.data.size", "10%", PropertyType.MEMORY,
"Specifies the size of the cache for RFile data blocks on each scan server.", "2.1.0"),
@Experimental
SSERV_INDEXCACHE_SIZE("sserver.cache.index.size", "25%", PropertyType.MEMORY,
"Specifies the size of the cache for RFile index blocks on each scan server.", "2.1.0"),
@Experimental
SSERV_SUMMARYCACHE_SIZE("sserver.cache.summary.size", "10%", PropertyType.MEMORY,
"Specifies the size of the cache for summary data on each scan server.", "2.1.0"),
@Experimental
SSERV_DEFAULT_BLOCKSIZE("sserver.default.blocksize", "1M", PropertyType.BYTES,
"Specifies a default blocksize for the scan server caches.", "2.1.0"),
@Experimental
SSERV_GROUP_NAME("sserver.group", ScanServerSelector.DEFAULT_SCAN_SERVER_GROUP_NAME,
PropertyType.STRING,
"Resource group name for this ScanServer. Resource groups support at least two use cases:"
+ " dedicating resources to scans and/or using different hardware for scans. Clients can"
+ " configure the ConfigurableScanServerSelector to specify the resource group to use for"
+ " eventual consistency scans.",
"3.0.0"),
@Experimental
SSERV_CACHED_TABLET_METADATA_EXPIRATION("sserver.cache.metadata.expiration", "5m",
PropertyType.TIMEDURATION,
"The time after which cached tablet metadata will be expired if not previously refreshed.",
"2.1.0"),
@Experimental
SSERV_CACHED_TABLET_METADATA_REFRESH_PERCENT("sserver.cache.metadata.refresh.percent", ".75",
PropertyType.FRACTION,
"The time after which cached tablet metadata will be refreshed, expressed as a "
+ "percentage of the expiration time. Cache hits after this time, but before the "
+ "expiration time, will trigger a background refresh for future hits. "
+ "Value must be less than 100%. Set to 0 will disable refresh.",
"2.1.3"),
@Experimental
SSERV_PORTSEARCH("sserver.port.search", "true", PropertyType.BOOLEAN,
"if the sserver.port.client ports are in use, search higher ports until one is available.",
"2.1.0"),
@Experimental
SSERV_CLIENTPORT("sserver.port.client", "9996", PropertyType.PORT,
"The port used for handling client connections on the tablet servers.", "2.1.0"),
@Experimental
SSERV_MINTHREADS("sserver.server.threads.minimum", "2", PropertyType.COUNT,
"The minimum number of threads to use to handle incoming requests.", "2.1.0"),
@Experimental
SSERV_MINTHREADS_TIMEOUT("sserver.server.threads.timeout", "0s", PropertyType.TIMEDURATION,
"The time after which incoming request threads terminate with no work available. Zero (0) will keep the threads alive indefinitely.",
"2.1.0"),
@Experimental
SSERV_SCAN_EXECUTORS_PREFIX("sserver.scan.executors.", null, PropertyType.PREFIX,
"Prefix for defining executors to service scans. See "
+ "[scan executors]({% durl administration/scan-executors %}) for an overview of why and"
Expand All @@ -541,7 +528,6 @@ public enum Property {
+ "`sserver.scan.executors.<name>.prioritizer=<class name>`, and "
+ "`sserver.scan.executors.<name>.prioritizer.opts.<key>=<value>`.",
"2.1.0"),
@Experimental
SSERV_SCAN_EXECUTORS_DEFAULT_THREADS("sserver.scan.executors.default.threads", "16",
PropertyType.COUNT, "The number of threads for the scan executor that tables use by default.",
"2.1.0"),
Expand All @@ -551,18 +537,14 @@ public enum Property {
+ "results in FIFO priority. Set to a class that implements "
+ ScanPrioritizer.class.getName() + " to configure one.",
"2.1.0"),
@Experimental
SSERV_SCAN_EXECUTORS_META_THREADS("sserver.scan.executors.meta.threads", "8", PropertyType.COUNT,
"The number of threads for the metadata table scan executor.", "2.1.0"),
@Experimental
SSERV_SCAN_REFERENCE_EXPIRATION_TIME("sserver.scan.reference.expiration", "5m",
PropertyType.TIMEDURATION,
"The amount of time a scan reference is unused before its deleted from metadata table.",
"2.1.0"),
@Experimental
SSERV_THREADCHECK("sserver.server.threadcheck.time", "1s", PropertyType.TIMEDURATION,
"The time between adjustments of the thrift server thread pool.", "2.1.0"),
@Experimental
SSERV_WAL_SORT_MAX_CONCURRENT("sserver.wal.sort.concurrent.max", "2", PropertyType.COUNT,
"The maximum number of threads to use to sort logs during recovery.", "4.0.0"),
// properties that are specific to tablet server behavior
Expand Down Expand Up @@ -1153,7 +1135,6 @@ public enum Property {
+ "constraint.",
"2.0.0"),
// Compactor properties
@Experimental
COMPACTOR_PREFIX("compactor.", null, PropertyType.PREFIX,
"Properties in this category affect the behavior of the accumulo compactor server.", "2.1.0"),
COMPACTOR_CANCEL_CHECK_INTERVAL("compactor.cancel.check.interval", "5m",
Expand All @@ -1162,11 +1143,9 @@ public enum Property {
+ " should be cancelled. This checks for situations like was the tablet deleted (split "
+ " and merge do this), was the table deleted, was a user compaction canceled, etc.",
"2.1.4"),
@Experimental
COMPACTOR_PORTSEARCH("compactor.port.search", "true", PropertyType.BOOLEAN,
"If the compactor.port.client ports are in use, search higher ports until one is available.",
"2.1.0"),
@Experimental
COMPACTOR_CLIENTPORT("compactor.port.client", "9133", PropertyType.PORT,
"The port used for handling client connections on the compactor servers.", "2.1.0"),
COMPACTOR_MIN_JOB_WAIT_TIME("compactor.wait.time.job.min", "1s", PropertyType.TIMEDURATION,
Expand All @@ -1177,21 +1156,16 @@ public enum Property {
"Compactors do exponential backoff when their request for work repeatedly come back empty. "
+ "This is the maximum amount of time to wait between checks for the next compaction job.",
"2.1.3"),
@Experimental
COMPACTOR_MINTHREADS("compactor.threads.minimum", "1", PropertyType.COUNT,
"The minimum number of threads to use to handle incoming requests.", "2.1.0"),
@Experimental
COMPACTOR_MINTHREADS_TIMEOUT("compactor.threads.timeout", "0s", PropertyType.TIMEDURATION,
"The time after which incoming request threads terminate with no work available. Zero (0) will keep the threads alive indefinitely.",
"2.1.0"),
@Experimental
COMPACTOR_THREADCHECK("compactor.threadcheck.time", "1s", PropertyType.TIMEDURATION,
"The time between adjustments of the server thread pool.", "2.1.0"),
@Experimental
COMPACTOR_GROUP_NAME("compactor.group", Constants.DEFAULT_RESOURCE_GROUP_NAME,
PropertyType.STRING, "Resource group name for this Compactor.", "3.0.0"),
// CompactionCoordinator properties
@Experimental
COMPACTION_COORDINATOR_PREFIX("compaction.coordinator.", null, PropertyType.PREFIX,
"Properties in this category affect the behavior of the accumulo compaction coordinator server.",
"2.1.0"),
Expand All @@ -1207,7 +1181,6 @@ public enum Property {
"64", PropertyType.COUNT,
"The number of threads used to reserve files for compaction in a tablet for user tables.",
"4.0.0"),
@Experimental
COMPACTION_COORDINATOR_DEAD_COMPACTOR_CHECK_INTERVAL(
"compaction.coordinator.compactor.dead.check.interval", "5m", PropertyType.TIMEDURATION,
"The interval at which to check for dead compactors.", "2.1.0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ public void lock() {
return;
}
} catch (InterruptedException ex) {
// ignored
Thread.currentThread().interrupt();
log.warn("Interrupted while waiting to acquire lock", ex);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public RunningCompactionInfo(TExternalCompaction ec) {
if (lastEntry != null) {
last = lastEntry.getValue();
updateMillis = lastEntry.getKey();
duration = last.getCompactionAgeNanos();
duration = NANOSECONDS.toMillis(last.getCompactionAgeNanos());
} else {
log.debug("No updates found for {}", ecid);
lastUpdate = 1;
Expand All @@ -84,7 +84,7 @@ public RunningCompactionInfo(TExternalCompaction ec) {
duration = 0;
return;
}
long durationMinutes = NANOSECONDS.toMinutes(duration);
long durationMinutes = MILLISECONDS.toMinutes(duration);
if (durationMinutes > 15) {
log.warn("Compaction {} has been running for {} minutes", ecid, durationMinutes);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import static java.util.concurrent.TimeUnit.MILLISECONDS;

import java.util.List;
import java.util.OptionalInt;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.atomic.AtomicReference;
Expand All @@ -31,6 +32,7 @@
import org.apache.accumulo.core.conf.AccumuloConfiguration;
import org.apache.accumulo.core.conf.Property;
import org.apache.accumulo.core.conf.SiteConfiguration;
import org.apache.accumulo.core.conf.cluster.ClusterConfigParser;
import org.apache.accumulo.core.lock.ServiceLock;
import org.apache.accumulo.core.metrics.MetricsProducer;
import org.apache.accumulo.core.metrics.thrift.MetricSource;
Expand Down Expand Up @@ -70,6 +72,7 @@ protected AbstractServer(String appName, ConfigOpts opts,
var siteConfig = opts.getSiteConfiguration();
this.hostname = siteConfig.get(Property.GENERAL_PROCESS_BIND_ADDRESS);
this.resourceGroup = getResourceGroupPropertyValue(siteConfig);
ClusterConfigParser.validateGroupNames(List.of(resourceGroup));
SecurityUtil.serverLogin(siteConfig);
context = serverContextFactory.apply(siteConfig);
log = LoggerFactory.getLogger(getClass());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -572,22 +572,32 @@ private static void flushAll(final ClientContext context) {
try {
flusher.join(3000);
} catch (InterruptedException e) {
// ignore
Thread.currentThread().interrupt();
log.warn("Interrupted while waiting to join Flush thread", e);
}

while (flusher.isAlive() && System.currentTimeMillis() - start < 15000) {
int flushCount = flushesStarted.get();
try {
flusher.join(1000);
} catch (InterruptedException e) {
// ignore
Thread.currentThread().interrupt();
log.warn("Interrupted while waiting to join Flush thread", e);
}

if (flushCount == flushesStarted.get()) {
// no progress was made while waiting for join... maybe its stuck, stop waiting on it
break;
}
}

flusher.interrupt();
try {
flusher.join();
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
log.warn("Interrupted while waiting to join Flush thread", e);
}
}

private static void stopServer(final ClientContext context, final boolean tabletServersToo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function refresh() {
/**
* Initializes the bulk import DataTables
*/
$(document).ready(function () {
$(function () {

const url = '/rest/bulkImports';
console.debug('REST url used to fetch data for the DataTables in bulkImport.js: ' + url);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var compactionsList;
/**
* Creates active compactions table
*/
$(document).ready(function () {
$(function () {
// Create a table for compactions list
compactionsList = $('#compactionsList').DataTable({
"ajax": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var runningTableData;
/**
* Creates active compactions table
*/
$(document).ready(function () {
$(function () {
if (sessionStorage.ecDetailsJSON === undefined) {
sessionStorage.ecDetailsJSON = JSON.stringify([]);
}
Expand Down Expand Up @@ -85,7 +85,6 @@ $(document).ready(function () {
"columnDefs": [{
"targets": "duration",
"render": function (data, type, row) {
data = data / 1_000_000; // convert from nanos to millis
if (type === 'display') data = timeDuration(data);
return data;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var gcTable;
/**
* Creates active compactions table
*/
$(document).ready(function () {
$(function () {
// Create a table for compactions list
gcTable = $('#gcActivity').DataTable({
"ajax": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function refreshManagerTables() {
/**
* Creates initial tables
*/
$(document).ready(function () {
$(function () {

// Generates the manager table
managerStatusTable = $('#managerStatus').DataTable({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function updateServerNotifications(statusData) {
/**
* Creates the initial sidebar
*/
$(document).ready(function () {
$(function () {
refreshSidebar();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
/**
* Creates overview initial table
*/
$(document).ready(function () {
$(function () {
refreshOverview();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var scansList;
/**
* Creates scans initial table
*/
$(document).ready(function () {
$(function () {
// Create a table for scans list
scansList = $('#scansList').DataTable({
"ajax": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ function updateSystemAlerts() {
updateManagerAlerts();
}

$(document).ready(function () {
$(function () {

// dismiss the alert when clicked
$('#systemAlertCloseButton').click(function () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ function clearDeadTServers(server) {
/**
* Creates initial tables
*/
$(document).ready(function () {
$(function () {

refreshRecoveryList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
/**
* Sets up autorefresh on initial load
*/
$(document).ready(function() {
$(function() {
setupAutoRefresh();
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
-->
<script>
$(document).ready(function () {
$(function () {
// initialize DataTables
initServerTables('${server}');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* Creates participating Tservers initial table, passes the tableID from the template
*/
$(document).ready(function () {
$(function () {
initTableServerTable('${tableID}');
});
</script>
Expand Down
Loading

0 comments on commit c098e89

Please sign in to comment.