Skip to content

Commit

Permalink
Merge branch 'main' into elasticity
Browse files Browse the repository at this point in the history
  • Loading branch information
ddanielr committed Jan 22, 2024
2 parents fd387ba + 5922d90 commit e468fd3
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 31 deletions.
42 changes: 21 additions & 21 deletions assemble/src/main/resources/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -678,27 +678,27 @@ to the terms and conditions of the following licenses.

## org.slf4j:slf4j-api

Copyright (c) 2004-2023 QOS.ch
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Copyright (c) 2004-2023 QOS.ch
All rights reserved.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

## Various dependencies under the CC0 license / public domain

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.Collections2;

import io.opentelemetry.api.trace.Span;
import io.opentelemetry.context.Scope;

Expand Down Expand Up @@ -207,11 +209,13 @@ public CompactionStats call() throws IOException, CompactionCanceledException {

boolean remove = runningCompactions.add(this);

String threadStartDate = dateFormatter.format(new Date());

clearStats();

String oldThreadName = Thread.currentThread().getName();
String newThreadName = "MajC compacting " + extent + " started "
+ dateFormatter.format(new Date()) + " file: " + outputFile;
String newThreadName =
"MajC compacting " + extent + " started " + threadStartDate + " file: " + outputFile;
Thread.currentThread().setName(newThreadName);
thread = Thread.currentThread();
try {
Expand Down Expand Up @@ -281,7 +285,13 @@ public CompactionStats call() throws IOException, CompactionCanceledException {
log.debug("Compaction canceled {}", extent);
throw e;
} catch (IOException | RuntimeException e) {
log.error("{}", e.getMessage(), e);
Collection<String> inputFileNames =
Collections2.transform(getFilesToCompact(), StoredTabletFile::getFileName);
String outputFileName = outputFile.getFileName();
log.error(
"Compaction error. Compaction info: "
+ "extent: {}, input files: {}, output file: {}, iterators: {}, start date: {}",
getExtent(), inputFileNames, outputFileName, getIterators(), threadStartDate, e);
throw e;
} finally {
Thread.currentThread().setName(oldThreadName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@ protected Runnable createCompactionJob(final TExternalCompactionJob job,
} catch (FileCompactor.CompactionCanceledException cce) {
LOG.debug("Compaction canceled {}", job.getExternalCompactionId());
} catch (Exception e) {
LOG.error("Compaction failed", e);
KeyExtent fromThriftExtent = KeyExtent.fromThrift(job.getExtent());
LOG.error("Compaction failed: id: {}, extent: {}", job.getExternalCompactionId(),
fromThriftExtent, e);
err.set(e);
} finally {
stopped.countDown();
Expand Down Expand Up @@ -741,14 +743,17 @@ public void run() {
currentCompactionId.set(null);
}
} else if (err.get() != null) {
KeyExtent fromThriftExtent = KeyExtent.fromThrift(job.getExtent());
try {
LOG.info("Updating coordinator with compaction failure.");
LOG.info("Updating coordinator with compaction failure: id: {}, extent: {}",
job.getExternalCompactionId(), fromThriftExtent);
TCompactionStatusUpdate update = new TCompactionStatusUpdate(TCompactionState.FAILED,
"Compaction failed due to: " + err.get().getMessage(), -1, -1, -1);
updateCompactionState(job, update);
updateCompactionFailed(job);
} catch (RetriesExceededException e) {
LOG.error("Error updating coordinator with compaction failure.", e);
LOG.error("Error updating coordinator with compaction failure: id: {}, extent: {}",
job.getExternalCompactionId(), fromThriftExtent, e);
} finally {
currentCompactionId.set(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,8 @@ public void compactionFailed(TInfo tinfo, TCredentials credentials, String exter
throw new AccumuloSecurityException(credentials.getPrincipal(),
SecurityErrorCode.PERMISSION_DENIED).asThriftException();
}
LOG.info("Compaction failed, id: {}", externalCompactionId);
KeyExtent fromThriftExtent = KeyExtent.fromThrift(extent);
LOG.info("Compaction failed, id: {}, extent: {}", externalCompactionId, fromThriftExtent);
final var ecid = ExternalCompactionId.of(externalCompactionId);
compactionFailed(Map.of(ecid, KeyExtent.fromThrift(extent)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ private void detectDeadCompactions() {
this.deadCompactions.entrySet().stream().filter(e -> e.getValue() > 2)
.map(e -> e.getKey()).collect(Collectors.toCollection(TreeSet::new));
tabletCompactions.keySet().retainAll(toFail);
tabletCompactions.forEach((eci, v) -> {
log.warn("Compaction {} believed to be dead, failing it.", eci);
tabletCompactions.forEach((ecid, extent) -> {
log.warn("Compaction believed to be dead, failing it: id: {}, extent: {}", ecid, extent);
});
coordinator.compactionFailed(tabletCompactions);
this.deadCompactions.keySet().removeAll(toFail);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ protected Runnable createCompactionJob(TExternalCompactionJob job, LongAdder tot
throw new CompactionCanceledException();

} catch (Exception e) {
LOG.error("Compaction failed", e);
KeyExtent fromThriftExtent = KeyExtent.fromThrift(job.getExtent());
LOG.error("Compaction failed: id: {}, extent: {}", job.getExternalCompactionId(),
fromThriftExtent, e);
err.set(e);
} finally {
stopped.countDown();
Expand Down

0 comments on commit e468fd3

Please sign in to comment.