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

[INLONG-638] Issues About Disk Error recovery #482

Merged
merged 1 commit into from
Jun 15, 2021
Merged
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 @@ -25,6 +25,7 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import org.apache.tubemq.corebase.utils.CheckSum;
import org.apache.tubemq.corebase.utils.ServiceStatusHolder;
import org.apache.tubemq.server.broker.utils.DataStoreUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -112,6 +113,9 @@ private FileSegment(final long start, final File file,
this.cachedSize.set(this.channel.size());
this.flushedSize.set(this.cachedSize.get());
} catch (final Exception e) {
if (e instanceof IOException) {
ServiceStatusHolder.addReadIOErrCnt();
}
if (this.segmentType == SegmentType.DATA) {
logger.error("[File Store] Set DATA Segment cachedSize error", e);
} else {
Expand All @@ -133,6 +137,9 @@ public void close() {
}
this.randFile.close();
} catch (Throwable ee) {
if (ee instanceof IOException) {
ServiceStatusHolder.addReadIOErrCnt();
}
logger.error(new StringBuilder(512).append("[File Store] Close ")
.append(this.file.getAbsoluteFile().toString())
.append("'s ").append(segmentType).append(" file failure").toString(), ee);
Expand All @@ -152,6 +159,9 @@ public void deleteFile() {
}
this.randFile.close();
} catch (Throwable e1) {
if (e1 instanceof IOException) {
ServiceStatusHolder.addReadIOErrCnt();
}
logger.error("[File Store] failure to close channel ", e1);
}
try {
Expand All @@ -160,6 +170,9 @@ public void deleteFile() {
.append(file.getAbsoluteFile()).toString());
this.file.delete();
} catch (Throwable ee) {
if (ee instanceof IOException) {
ServiceStatusHolder.addReadIOErrCnt();
}
logger.error("[File Store] failure to delete file ", ee);
}
}
Expand Down