Thursday, November 24, 2016

Verify consistency of Volume

                                     Verify consistency of Volume


There might be issues while accessing files in file system you get I/O errors or unexpected errors. To validate consistency of the volume we can perform below steps.

1) Creating snapshot of a volume.

 maprcli volume snapshot create -snapshotname usersnapshot -volume users

2) List the snapshot to get the snapshotid for the volume we trying to check the consistency.

 maprcli volume snapshot list
cumulativeReclaimSizeMB  creationtime                  ownername  snapshotid  volumeSnapshotAces  snapshotname   volumeid  volumename  ownertype  volumepath  

0                        Thu Nov 24 23:32:50 IST 2016  mapr       256000051   ...                 usersnapshot   95706557  users       1          /user       

3) GFSCK (ReadOnly command) runs in 3 steps to check the consistency of the volume. Below are the phases and what is done in each phase .

i) Get container list from CLDB for the volume 
ii) Get inode from all containers of the volume
iii) Check container map ,fid map,Snap chain list for consistency

Finally full report is printed with list of inconsistencies if any.

Example Run.

 /opt/mapr/bin/gfsck snapshotid=256000051

parseint snapshotid=256000051
Starting GlobalFsck:
  clear-mode = false
  debug-mode = false
  dbcheck-mode = false
  repair-mode = false
  assume-yes-mode = false
  cluster = mapr5.1
  rw-volume-name = null
  snapshot-name = null
  snapshot-id = 256000051
  user-id = 0
  group-id = 0

  get snapshot properties ...
  get volume properties ...

  starting phase one (get containers) for volume usersnapshot(256000051) ...
    got snapshot containers map
  done phase one

  starting phase two (get inodes) for volume usersnapshot(256000051) ...
    cid translation list is verified for 256000061
    got container inode lists
  done phase two

  starting phase three (get fidmaps & tabletmaps) for volume usersnapshot(256000051) ...
    got fidmap lists
    got tabletmap lists
    Starting DeferMapCheck..
    completed DeferMapCheck
  done phase three

  === Start of GlobalFsck Report ===

  file-fidmap-filelet union --
    no errors

  table-tabletmap-tablet union --
    empty

  Dangling DB pointers --
    none


  orphan directories --
    none

  orphan kvstores --
    none

  orphan files --
    none

  orphan fidmaps --
    none

  orphan tables --
    none

  orphan tabletmaps --
    none

  orphan dbkvstores --
    none

  orphan dbfiles --
    none

  orphan dbinodes --
    none

  containers that need repair --
    none

  incomplete snapshots that need to be deleted --
    none

  user statistics --
    containers = 6
    directories = 25
    kvstores = 0
    xattrKvStore = 0
    xattrInline = 0
    files = 1002
    fidmaps = 0
    filelets = 0
    tables = 0
    tabletmaps = 0
    schemas = 0
    tablets = 0
    segmaps = 0
    spillmaps = 0
    overflowfiles = 0
    bucketfiles = 0
    spillfiles = 0
    defermaps = 0

  === End of GlobalFsck Report ===

GlobalFsck completed successfully (515 ms); Result: verify succeeded


No comments:

Post a Comment