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

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_r307538039
 
 

 ##########
 File path: 
hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/keyvalue/KeyValueContainerCheck.java
 ##########
 @@ -220,43 +229,66 @@ private void checkBlockDB() throws IOException {
       throw new IOException(dbFileErrorMsg);
     }
 
-
     onDiskContainerData.setDbFile(dbFile);
     try(ReferenceCountedDB db =
-            BlockUtils.getDB(onDiskContainerData, checkConfig)) {
-      iterateBlockDB(db);
-    }
-  }
+            BlockUtils.getDB(onDiskContainerData, checkConfig);
+        KeyValueBlockIterator kvIter = new KeyValueBlockIterator(containerID,
+            new File(onDiskContainerData.getContainerPath()))) {
 
-  private void iterateBlockDB(ReferenceCountedDB db)
-      throws IOException {
-    Preconditions.checkState(db != null);
-
-    // get "normal" keys from the Block DB
-    try(KeyValueBlockIterator kvIter = new KeyValueBlockIterator(containerID,
-        new File(onDiskContainerData.getContainerPath()))) {
-
-      // ensure there is a chunk file for each key in the DB
-      while (kvIter.hasNext()) {
+      while(kvIter.hasNext()) {
         BlockData block = kvIter.nextBlock();
-
-        List<ContainerProtos.ChunkInfo> chunkInfoList = block.getChunks();
-        for (ContainerProtos.ChunkInfo chunk : chunkInfoList) {
-          File chunkFile;
-          chunkFile = ChunkUtils.getChunkFile(onDiskContainerData,
+        for(ContainerProtos.ChunkInfo chunk : block.getChunks()) {
+          File chunkFile = ChunkUtils.getChunkFile(onDiskContainerData,
               ChunkInfo.getFromProtoBuf(chunk));
-
           if (!chunkFile.exists()) {
             // concurrent mutation in Block DB? lookup the block again.
             byte[] bdata = db.getStore().get(
                 Longs.toByteArray(block.getBlockID().getLocalID()));
-            if (bdata == null) {
-              LOG.trace("concurrency with delete, ignoring deleted block");
-              break; // skip to next block from kvIter
-            } else {
-              String errorStr = "Missing chunk file "
-                  + chunkFile.getAbsolutePath();
-              throw new IOException(errorStr);
+            if (bdata != null) {
+              throw new IOException("Missing chunk file "
+                  + chunkFile.getAbsolutePath());
+            }
+          } else if (chunk.getChecksumData().getType()
+              != ContainerProtos.ChecksumType.NONE){
 
 Review comment:
   Also what happens if CheckSum type is none ? we silently skip? That makes 
sense, just asking to make sure that my understanding is correct.
 
----------------------------------------------------------------
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:
[email protected]


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

    Worklog Id:     (was: 283000)

> 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
>  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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to