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

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

                Author: ASF GitHub Bot
            Created on: 22/Aug/19 02:30
            Start Date: 22/Aug/19 02:30
    Worklog Time Spent: 10m 
      Work Description: arp7 commented on pull request #1130: HDDS-1827. Load 
Snapshot info when OM Ratis server starts.
URL: https://github.com/apache/hadoop/pull/1130#discussion_r316474797
 
 

 ##########
 File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/om/TestOzoneManagerHA.java
 ##########
 @@ -1063,4 +1066,101 @@ static String createKey(OzoneBucket ozoneBucket) 
throws IOException {
     ozoneOutputStream.close();
     return keyName;
   }
+
+  @Test
+  public void testOMRestart() throws Exception {
+    // Get the leader OM
+    String leaderOMNodeId = objectStore.getClientProxy().getOMProxyProvider()
+        .getCurrentProxyOMNodeId();
+    OzoneManager leaderOM = cluster.getOzoneManager(leaderOMNodeId);
+
+    // Get follower OMs
+    OzoneManager followerOM1 = cluster.getOzoneManager(
+        leaderOM.getPeerNodes().get(0).getOMNodeId());
+    OzoneManager followerOM2 = cluster.getOzoneManager(
+        leaderOM.getPeerNodes().get(1).getOMNodeId());
+
+    // Do some transactions so that the log index increases
+    String userName = "user" + RandomStringUtils.randomNumeric(5);
+    String adminName = "admin" + RandomStringUtils.randomNumeric(5);
+    String volumeName = "volume" + RandomStringUtils.randomNumeric(5);
+    String bucketName = "bucket" + RandomStringUtils.randomNumeric(5);
+
+    VolumeArgs createVolumeArgs = VolumeArgs.newBuilder()
+        .setOwner(userName)
+        .setAdmin(adminName)
+        .build();
+
+    objectStore.createVolume(volumeName, createVolumeArgs);
+    OzoneVolume retVolumeinfo = objectStore.getVolume(volumeName);
+
+    retVolumeinfo.createBucket(bucketName);
+    OzoneBucket ozoneBucket = retVolumeinfo.getBucket(bucketName);
+
+    for (int i = 0; i < 10; i++) {
+      createKey(ozoneBucket);
+    }
+
+    long lastAppliedTxOnFollowerOM =
+        followerOM1.getOmRatisServer().getStateMachineLastAppliedIndex();
+
+    // Stop one follower OM
+    followerOM1.stop();
+
+    // Do more transactions. Stopped OM should miss these transactions and
+    // the logs corresponding to atleast some of the missed transactions
+    // should be purged. This will force the OM to install snapshot when
+    // restarted.
+    long minNewTxIndex = lastAppliedTxOnFollowerOM + (LOG_PURGE_GAP * 10);
 
 Review comment:
   There is no guarantee that the purge has occurred right?
 
----------------------------------------------------------------
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: 299115)
    Time Spent: 3h 10m  (was: 3h)

> Load Snapshot info when OM Ratis server starts
> ----------------------------------------------
>
>                 Key: HDDS-1827
>                 URL: https://issues.apache.org/jira/browse/HDDS-1827
>             Project: Hadoop Distributed Data Store
>          Issue Type: Sub-task
>            Reporter: Hanisha Koneru
>            Assignee: Hanisha Koneru
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 3h 10m
>  Remaining Estimate: 0h
>
> When Ratis server is starting it looks for the latest snapshot to load it. 
> Even though OM does not save snapshots via Ratis, we need to load the saved 
> snaphsot index into Ratis so that the LogAppender knows to not look for logs 
> before the snapshot index. Otherwise, Ratis will replay the logs from 
> beginning every time it starts up.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to