hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r820889 - in /hadoop/hbase/branches/0.20: ./ src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/ src/contrib/transactional/src/test/org/apache/hadoop/hbase/regionserver/transactional/
Date Fri, 02 Oct 2009 05:22:50 GMT
Author: stack
Date: Fri Oct  2 05:22:50 2009
New Revision: 820889

URL: http://svn.apache.org/viewvc?rev=820889&view=rev
Log:
HBASE-1879  ReadOnly transactions generate WAL activity.

Modified:
    hadoop/hbase/branches/0.20/CHANGES.txt
    hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLog.java
    hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogKey.java
    hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogRecoveryManager.java
    hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionalRegion.java
    hadoop/hbase/branches/0.20/src/contrib/transactional/src/test/org/apache/hadoop/hbase/regionserver/transactional/TestTHLog.java

Modified: hadoop/hbase/branches/0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/CHANGES.txt?rev=820889&r1=820888&r2=820889&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20/CHANGES.txt Fri Oct  2 05:22:50 2009
@@ -60,6 +60,7 @@
    HBASE-1874  Client Scanner mechanism that is used for HbaseAdmin methods
                (listTables, tableExists), is very slow if the client is far
                away from the HBase cluster (Andrei Dragomir via Stack)
+   HBASE-1879  ReadOnly transactions generate WAL activity (Clint Morgan via Stack)
 
 Release 0.20.0 - Tue Sep  8 12:48:41 PDT 2009
 

Modified: hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLog.java?rev=820889&r1=820888&r2=820889&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLog.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLog.java
Fri Oct  2 05:22:50 2009
@@ -58,11 +58,6 @@
     return new THLogKey(regionName, tableName, seqNum, now);
   }
 
-  public void writeStartToLog(HRegionInfo regionInfo, final long transactionId) throws IOException
{
-    this.append(regionInfo, System.currentTimeMillis(),
-        THLogKey.TrxOp.START, transactionId);
-  }
-
   public void writeUpdateToLog(HRegionInfo regionInfo, final long transactionId, final Put
update)
       throws IOException {
     this.append(regionInfo, update, transactionId);

Modified: hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogKey.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogKey.java?rev=820889&r1=820888&r2=820889&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogKey.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogKey.java
Fri Oct  2 05:22:50 2009
@@ -31,8 +31,6 @@
    *  
    */
   public enum TrxOp {
-    /** Start a transaction. */
-    START((byte)1), 
     /** A standard operation that is transactional. KV holds the op. */
     OP((byte)2), 
     /** A transaction was committed. */

Modified: hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogRecoveryManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogRecoveryManager.java?rev=820889&r1=820888&r2=820889&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogRecoveryManager.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/THLogRecoveryManager.java
Fri Oct  2 05:22:50 2009
@@ -140,23 +140,11 @@
         List<KeyValue> updates = pendingTransactionsById.get(transactionId);
         switch (key.getTrxOp()) {
 
-        case START:
-          if (updates != null || abortedTransactions.contains(transactionId)
-              || commitedTransactions.contains(transactionId)) {
-            LOG.error("Processing start for transaction: " + transactionId
-                + ", but have already seen start message");
-            throw new IOException("Corrupted transaction log");
-          }
-          updates = new ArrayList<KeyValue>();
-          pendingTransactionsById.put(transactionId, updates);
-          startCount++;
-          break;
-
         case OP:
           if (updates == null) {
-            LOG.error("Processing edit for transaction: " + transactionId
-                + ", but have not seen start message");
-            throw new IOException("Corrupted transaction log");
+              updates = new ArrayList<KeyValue>();
+              pendingTransactionsById.put(transactionId, updates);
+              startCount++;
           }
 
           updates.add(val);

Modified: hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionalRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionalRegion.java?rev=820889&r1=820888&r2=820889&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionalRegion.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/transactional/src/java/org/apache/hadoop/hbase/regionserver/transactional/TransactionalRegion.java
Fri Oct  2 05:22:50 2009
@@ -227,7 +227,6 @@
     }
     LOG.debug("Begining transaction " + key + " in region "
         + super.getRegionInfo().getRegionNameAsString());
-    this.hlog.writeStartToLog(super.getRegionInfo(), transactionId);
 
     maybeTriggerOldTransactionFlush();
   }
@@ -449,7 +448,9 @@
 
     state.setStatus(Status.ABORTED);
 
-    this.hlog.writeAbortToLog(super.getRegionInfo(), state.getTransactionId());
+    if (state.hasWrite()) {
+      this.hlog.writeAbortToLog(super.getRegionInfo(), state.getTransactionId());
+    }
 
     // Following removes needed if we have voted
     if (state.getSequenceNumber() != null) {
@@ -475,9 +476,11 @@
       this.delete(delete, null, true);
     }
     
-    // Now the transaction lives in the WAL, we can writa a commit to the log 
+    // Now the transaction lives in the WAL, we can write a commit to the log 
     // so we don't have to recover it.
-    this.hlog.writeCommitToLog(super.getRegionInfo(), state.getTransactionId());
+    if (state.hasWrite()) {
+      this.hlog.writeCommitToLog(super.getRegionInfo(), state.getTransactionId());
+    }
 
     state.setStatus(Status.COMMITED);
     if (state.hasWrite()

Modified: hadoop/hbase/branches/0.20/src/contrib/transactional/src/test/org/apache/hadoop/hbase/regionserver/transactional/TestTHLog.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/contrib/transactional/src/test/org/apache/hadoop/hbase/regionserver/transactional/TestTHLog.java?rev=820889&r1=820888&r2=820889&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/contrib/transactional/src/test/org/apache/hadoop/hbase/regionserver/transactional/TestTHLog.java
(original)
+++ hadoop/hbase/branches/0.20/src/contrib/transactional/src/test/org/apache/hadoop/hbase/regionserver/transactional/TestTHLog.java
Fri Oct  2 05:22:50 2009
@@ -86,8 +86,6 @@
     // Write columns named 1, 2, 3, etc. and then values of single byte
     // 1, 2, 3...
     long transactionId = 1;
-    log.writeStartToLog(regionInfo, transactionId);
-
     log.writeUpdateToLog(regionInfo, transactionId, new Put(row1).add(family,
         column, val1));
     log.writeUpdateToLog(regionInfo, transactionId, new Put(row2).add(family,
@@ -119,8 +117,6 @@
         regionInfo, conf);
 
     long transactionId = 1;
-    log.writeStartToLog(regionInfo, transactionId);
-
     log.writeUpdateToLog(regionInfo, transactionId, new Put(row1).add(family,
         column, val1));
     log.writeUpdateToLog(regionInfo, transactionId, new Put(row2).add(family,
@@ -152,11 +148,9 @@
     long transaction1Id = 1;
     long transaction2Id = 2;
 
-    log.writeStartToLog(regionInfo, transaction1Id);
     log.writeUpdateToLog(regionInfo, transaction1Id, new Put(row1).add(family,
         column, val1));
 
-    log.writeStartToLog(regionInfo, transaction2Id);
     log.writeUpdateToLog(regionInfo, transaction2Id, new Put(row2).add(family,
         column, val2));
 
@@ -189,11 +183,9 @@
     long transaction1Id = 1;
     long transaction2Id = 2;
 
-    log.writeStartToLog(regionInfo, transaction1Id);
     log.writeUpdateToLog(regionInfo, transaction1Id, new Put(row1).add(family,
         column, val1));
 
-    log.writeStartToLog(regionInfo, transaction2Id);
     log.writeUpdateToLog(regionInfo, transaction2Id, new Put(row2).add(family,
         column, val2));
     log.writeAbortToLog(regionInfo, transaction2Id);
@@ -226,11 +218,9 @@
     long transaction1Id = 1;
     long transaction2Id = 2;
 
-    log.writeStartToLog(regionInfo, transaction1Id);
     log.writeUpdateToLog(regionInfo, transaction1Id, new Put(row1).add(family,
         column, val1));
 
-    log.writeStartToLog(regionInfo, transaction2Id);
     log.writeUpdateToLog(regionInfo, transaction2Id, new Put(row2).add(family,
         column, val2));
     log.writeCommitToLog(regionInfo, transaction2Id);



Mime
View raw message