Skip to content

HDDS-8781. Allow on demand metadata scanning of open containers #8442

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
change conditions, add debug log
  • Loading branch information
Tejaskriya committed May 22, 2025
commit 01677012b1bece54ef5eb9699f7d40a086933cf9
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,19 @@ private static void performOnDemandScan(Container<?> container) {
logScanStart(containerData);

ScanResult result = ScanResult.healthy();
// OPEN containers are scanned here for metadata only
if (container.shouldScanMetadata() && !container.shouldScanData()) {
result = container.scanMetaData();
} else if (container.shouldScanData()) {
if (container.shouldScanData()) {
LOG.debug("Performing data scan for container {}", container.getContainerData().getContainerID());
result = container.scanData(instance.throttler, instance.canceler);
// Metrics for skipped containers should not be updated.
if (result.getFailureType() == DELETED_CONTAINER) {
LOG.error("Container [{}] has been deleted.",
containerId, result.getException());
return;
}
} else if (container.shouldScanMetadata()) {
// OPEN containers are scanned here for metadata only
LOG.debug("Performing metadata-only scan for open container {}", container.getContainerData().getContainerID());
result = container.scanMetaData();
}
if (!result.isHealthy()) {
LOG.error("Corruption detected in container [{}]." +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void testCorruptionDetected(ContainerCorruptions corruption)

/**
* {@link OnDemandContainerScanner} should detect corrupted blocks
* in a open container when a client reads from it.
* in an open container when a client reads from it.
*/
@ParameterizedTest
@MethodSource("supportedCorruptionTypesForOpen")
Expand Down
Loading