[NO ISSUE][TXN] Fix txnid leak (off by one)

- user model changes: no
- storage format changes: no
- interface changes: no

Details:
- Fix leak of one id at start of each allocated block
- Increase block size from 100 -> 512

Change-Id: Ia97d8472f30ef0f68c51830b4cbb4660184d7393
Reviewed-on: https://asterix-gerrit.ics.uci.edu/2465
Sonar-Qube: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Contrib: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Till Westmann <tillw@apache.org>
diff --git a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
index d44bb13..6b3b6a0f 100644
--- a/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
+++ b/asterixdb/asterix-metadata/src/main/java/org/apache/asterix/metadata/CachingTxnIdFactory.java
@@ -89,7 +89,7 @@
         }
 
         private long nextId() throws BlockExhaustedException {
-            long nextId = id.incrementAndGet();
+            long nextId = id.getAndIncrement();
             if (nextId >= endExclusive && (endExclusive >= start || nextId < start)) {
                 throw BLOCK_EXHAUSTED_EXCEPTION;
             }
diff --git a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
index b8578ec..4e1c3b1 100644
--- a/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
+++ b/asterixdb/asterix-runtime/src/main/java/org/apache/asterix/runtime/message/TxnIdBlockRequest.java
@@ -33,7 +33,7 @@
 
 public class TxnIdBlockRequest implements ICcAddressedMessage {
     private static final Logger LOGGER = LogManager.getLogger();
-    private static final int BLOCK_SIZE = 100;
+    private static final int BLOCK_SIZE = 512;
     private static final long serialVersionUID = 1L;
 
     private static BlockingQueue<TxnIdBlockResponse> blockQueue = new LinkedBlockingQueue<>();