[ 
https://issues.apache.org/jira/browse/HDDS-1200?focusedWorklogId=283001&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-283001
 ]

ASF GitHub Bot logged work on HDDS-1200:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 25/Jul/19 23:28
            Start Date: 25/Jul/19 23:28
    Worklog Time Spent: 10m 
      Work Description: anuengineer commented on pull request #1154: 
[HDDS-1200] Add support for checksum verification in data scrubber
URL: https://github.com/apache/hadoop/pull/1154#discussion_r307538592
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/ozoneimpl/ContainerDataScanner.java
 ##########
 @@ -0,0 +1,108 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.ozone.container.ozoneimpl;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.apache.hadoop.hdfs.util.Canceler;
+import org.apache.hadoop.hdfs.util.DataTransferThrottler;
+import org.apache.hadoop.ozone.container.common.interfaces.Container;
+import org.apache.hadoop.ozone.container.common.volume.HddsVolume;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * VolumeScanner scans a single volume.  Each VolumeScanner has its own thread.
+ * <p>They are all managed by the DataNode's BlockScanner.
+ */
+public class ContainerDataScanner extends Thread {
+  public static final Logger LOG =
+      LoggerFactory.getLogger(ContainerDataScanner.class);
+
+  /**
+   * The volume that we're scanning.
+   */
+  private final HddsVolume volume;
+  private final ContainerController controller;
+  private final DataTransferThrottler throttler;
+  private final Canceler canceler;
+
+  /**
+   * True if the thread is stopping.<p/>
+   * Protected by this object's lock.
+   */
+  private volatile boolean stopping = false;
+
+
+  public ContainerDataScanner(ContainerController controller,
+                              HddsVolume volume, long bytesPerSec) {
+    this.controller = controller;
+    this.volume = volume;
+    this.throttler = new DataTransferThrottler(bytesPerSec);
+    this.canceler = new Canceler();
+    setName("ContainerDataScanner(" + volume + ")");
+    setDaemon(true);
+  }
+
+  @Override
+  public void run() {
+    LOG.trace("{}: thread starting.", this);
+    try {
+      while (!stopping) {
+        Iterator<Container> itr = controller.getContainers(volume);
+        while (!stopping && itr.hasNext()) {
+          Container c = itr.next();
+          try {
+            if (c.shouldScanData()) {
+              if(!c.scanData(throttler, canceler)) {
+                controller.markContainerUnhealthy(
+                    c.getContainerData().getContainerID());
+              }
+            }
+          } catch (IOException ex) {
+            long containerId = c.getContainerData().getContainerID();
+            LOG.warn("Unexpected exception while scanning container "
+                + containerId, ex);
 
 Review comment:
   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.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 283001)
    Time Spent: 1h 10m  (was: 1h)

> Ozone Data Scrubbing : Checksum verification for chunks
> -------------------------------------------------------
>
>                 Key: HDDS-1200
>                 URL: https://issues.apache.org/jira/browse/HDDS-1200
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Supratim Deka
>            Assignee: Hrishikesh Gadre
>            Priority: Critical
>              Labels: pull-request-available
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> Background scrubber should read each chunk and verify the checksum.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to