Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Halt TabletServer on minc failure and no TabletServer lock #5169

Open
wants to merge 1 commit into
base: 2.1
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.apache.accumulo.core.data.ByteSequence;
import org.apache.accumulo.core.manager.state.tables.TableState;
import org.apache.accumulo.core.metadata.TabletFile;
import org.apache.accumulo.core.util.Halt;
import org.apache.accumulo.core.util.LocalityGroupUtil;
import org.apache.accumulo.server.compaction.CompactionStats;
import org.apache.accumulo.server.compaction.FileCompactor;
Expand Down Expand Up @@ -93,7 +94,18 @@ public CompactionStats call() {
try {
do {
try {
CompactionStats ret = super.call();
CompactionStats ret = null;
try {
ret = super.call();
} catch (Exception e) {
if (tabletServer.getLock() == null || !tabletServer.getLock().verifyLockAtSource()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a small race condition here with calling getLock() twice? I'm not sure if it's possible for the state to really change in this case between reads but I was wondering if it's better to do something like

var lock = tabletServer.getLock();
if (lock == null || !lock.verifyLockAtSource()) {

log.error("Minor compaction of {} has failed and TabletServer lock does not exist."
+ " Halting...", getExtent(), e);
Halt.halt("TabletServer lock does not exist", -1);
} else {
throw e;
}
}

// log.debug(String.format("MinC %,d recs in | %,d recs out | %,d recs/sec | %6.3f secs |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious why these log messages are commented out.

// %,d bytes ",map.size(), entriesCompacted,
Expand Down
Loading