-
Notifications
You must be signed in to change notification settings - Fork 9.1k
[HDDS-1200] Add support for checksum verification in data scrubber #1154
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
Conversation
public static final boolean HDDS_SCM_SAFEMODE_ENABLED_DEFAULT = true; | ||
public static final String HDDS_SCM_SAFEMODE_MIN_DATANODE = | ||
"hdds.scm.safemode.min.datanode"; | ||
public static final int HDDS_SCM_SAFEMODE_MIN_DATANODE_DEFAULT = 1; | ||
|
||
public static final String HDDS_CONTAINER_SCANNER_VOLUME_BYTES_PER_SECOND = | ||
"hdds.container.scanner.volume.bytes.per.second"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could make this a bit more intuitive by adding let's say, throttle.bytes.per.second?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry my standard Ozone Comment: Can we please use the configuration based API for these changes.
https://cwiki.apache.org/confluence/display/HADOOP/Java-based+configuration+API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@swagle the property name is loosely modeled after HDFS. So i think we can keep it that way.
@anuengineer thanks for the info. Let me refactor the logic here to use configuration based API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the patch to use configuration based APIs.
scrub(); | ||
if (!stopping) { | ||
try { | ||
Thread.sleep(300000); /* 5 min between scans */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be configurable, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic was present in ContainerScrubber.java before this patch. I just refactored it. Let me make it configurable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good to me. thanks for getting this done. I have some minor comments.
public static final String HDDS_CONTAINER_SCANNER_VOLUME_BYTES_PER_SECOND = | ||
"hdds.container.scanner.volume.bytes.per.second"; | ||
public static final long | ||
HDDS_CONTAINER_SCANNER_VOLUME_BYTES_PER_SECOND_DEFAULT = 1048576L; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1048576L , ozone supports writing things like 1MB. if that is useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok. let me use that.
} | ||
BlockUtils.getDB(onDiskContainerData, checkConfig); | ||
KeyValueBlockIterator kvIter = new KeyValueBlockIterator(containerID, | ||
new File(onDiskContainerData.getContainerPath()))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please run this in a profiler mode -- and make sure there are no memory leaks in this code path. Nothing to do with your patch at all. Just that we have found some issues here earlier. Just run it under something like VisualVM and see if we release all memory when get out of the loop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
...service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java
Show resolved
Hide resolved
} catch (IOException ex) { | ||
long containerId = c.getContainerData().getContainerID(); | ||
LOG.warn("Unexpected exception while scanning container " | ||
+ containerId, ex); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are not able to read the container, should we mark the container as unhealthy ? even if we got an exception ? I am not sure if all exceptions do mean contianer is unhealthy, but for some exceptions; yes it is unhealthy.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we do mark the container as unhealthy in case of I/O errors. But there are some cases where we can not mark a container as unhealthy (e.g. when the rocksdb metadata is deleted or corrupted). In that case we just send an ICR to SCM. Here is relevant code snippet - https://github.com/apache/hadoop/blob/trunk/hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueHandler.java#L900-L915
* @throws Exception | ||
*/ | ||
@Test | ||
public void testKeyValueContainerCheckCorruption() throws Exception { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can run this test under memory profiler to make sure there are no leaks. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/label ozone
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add a label called ozone, then this pull request will be processed by Jenkins. Just FYI. I have done that for this patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure will do.
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
sc.getBandwidthPerVolume()), null); | ||
assertFalse(valid); | ||
} | ||
|
||
/** | ||
* Creates a container with normal and deleted blocks. | ||
* First it will insert normal blocks, and then it will insert |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Milsleading comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I am following you. Can you elaborate which part do you find misleading? This function was present before this patch ...
} | ||
if (v == -1 && i < length) { | ||
throw new OzoneChecksumException(String | ||
.format("Inconsistent read for chunk=%s expected length=%d" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be a good idea to log the blockId as well in the exception msg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Thanks @hgadre for working on this. The patch looks good to me with few minor comments. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
6a42ca0
to
8d3c73d
Compare
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@hgadre Thanks for the contribution. All others thanks for the review. I have committed this patch to the trunk. |
…1154) * Fix discrepancy between sql REAL and FLOAT
No description provided.