Dedeepya-T commented on a change in pull request #99:
URL: https://github.com/apache/qpid-broker-j/pull/99#discussion_r669706637



##########
File path: 
bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java
##########
@@ -1196,6 +1206,75 @@ public void onNoMajority()
                    masterListener.awaitForStateChange(State.MASTER, _timeout, 
TimeUnit.SECONDS));
     }
 
+    @Test
+    public void testNodeCommitNoSync()  throws Exception
+    {
+        DatabaseConfig createConfig = new DatabaseConfig();
+        createConfig.setAllowCreate(true);
+        createConfig.setTransactional(true);
+
+        TestStateChangeListener masterListener = new TestStateChangeListener();
+        ReplicatedEnvironmentFacade node1 = addNode(TEST_NODE_NAME, 
TEST_NODE_HOST_PORT, true, masterListener, new NoopReplicationGroupListener(),
+                                                    "NO_SYNC,NO_SYNC,NONE");
+        assertTrue("Environment was not created", 
masterListener.awaitForStateChange(State.MASTER,
+                                                                               
      _timeout, TimeUnit.SECONDS));
+
+        String replicaNodeHostPort = "localhost:" + 
_portHelper.getNextAvailable();
+        String replicaName = TEST_NODE_NAME + 1;
+        ReplicatedEnvironmentFacade node2 = createReplica(replicaName, 
replicaNodeHostPort, new NoopReplicationGroupListener());
+
+        Database db = node1.openDatabase("mydb", createConfig);
+
+        // Put a record (using commitNoSync)
+        DatabaseEntry key = new DatabaseEntry();
+        DatabaseEntry data = new DatabaseEntry();
+
+        TransactionConfig transactionConfig = new TransactionConfig();
+        transactionConfig.setDurability(node1.getRealMessageStoreDurability());
+
+        Transaction txn = node1.beginTransaction(null);
+        IntegerBinding.intToEntry(1, key);
+        StringBinding.stringToEntry("value", data);
+
+        db.put(txn, key, data);
+        node1.commitNoSync(txn);
+        db.close();
+
+        // Stop node1
+        node1.close();
+        node2.close();
+
+        LOGGER.debug("RESTARTING " + TEST_NODE_NAME);
+
+        node1 = addNode(TEST_NODE_NAME, TEST_NODE_HOST_PORT, true, 
masterListener, new NoopReplicationGroupListener(),
+                        null);
+        boolean awaitForStateChange = 
masterListener.awaitForStateChange(State.MASTER,
+                                                                               
    _timeout, TimeUnit.SECONDS);
+        LOGGER.debug("RESTARTING " + replicaName);
+        TestStateChangeListener node2StateChangeListener = new 
TestStateChangeListener();
+        node2 = addNode(replicaName, replicaNodeHostPort, false, 
node2StateChangeListener, new NoopReplicationGroupListener(),
+                        null);
+        db = node1.openDatabase("mydb", DatabaseConfig.DEFAULT);
+        txn = node1.beginTransaction(transactionConfig);

Review comment:
       Done

##########
File path: 
bdbstore/src/test/java/org/apache/qpid/server/store/berkeleydb/replication/ReplicatedEnvironmentFacadeTest.java
##########
@@ -1196,6 +1206,75 @@ public void onNoMajority()
                    masterListener.awaitForStateChange(State.MASTER, _timeout, 
TimeUnit.SECONDS));
     }
 
+    @Test
+    public void testNodeCommitNoSync()  throws Exception

Review comment:
       Done




-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



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

Reply via email to