You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2017/01/11 18:19:49 UTC
[33/50] [abbrv] hadoop git commit: HDFS-11292. log lastWrittenTxId
etc info in logSyncAll. Contributed by Yongjun Zhang.
HDFS-11292. log lastWrittenTxId etc info in logSyncAll. Contributed by Yongjun Zhang.
Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/603cbcd5
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/603cbcd5
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/603cbcd5
Branch: refs/heads/HADOOP-13345
Commit: 603cbcd513a74c29e0e4ec9dc181ff08887d64a4
Parents: 0a212a4
Author: Yongjun Zhang <yz...@cloudera.com>
Authored: Mon Jan 9 15:44:42 2017 -0800
Committer: Yongjun Zhang <yz...@cloudera.com>
Committed: Mon Jan 9 15:44:42 2017 -0800
----------------------------------------------------------------------
.../hadoop/hdfs/server/namenode/FSEditLog.java | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/hadoop/blob/603cbcd5/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
index c9ee32b..8454a46 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSEditLog.java
@@ -596,7 +596,15 @@ public class FSEditLog implements LogsPurgeable {
*/
void logSyncAll() {
// Make sure we're synced up to the most recent transaction ID.
- logSync(getLastWrittenTxId());
+ long lastWrittenTxId = getLastWrittenTxId();
+ LOG.info("logSyncAll toSyncToTxId=" + lastWrittenTxId
+ + " lastSyncedTxid=" + synctxid
+ + " mostRecentTxid=" + txid);
+ logSync(lastWrittenTxId);
+ lastWrittenTxId = getLastWrittenTxId();
+ LOG.info("Done logSyncAll lastWrittenTxId=" + lastWrittenTxId
+ + " lastSyncedTxid=" + synctxid
+ + " mostRecentTxid=" + txid);
}
/**
@@ -1358,7 +1366,8 @@ public class FSEditLog implements LogsPurgeable {
* Transitions from IN_SEGMENT state to BETWEEN_LOG_SEGMENTS state.
*/
public synchronized void endCurrentLogSegment(boolean writeEndTxn) {
- LOG.info("Ending log segment " + curSegmentTxId);
+ LOG.info("Ending log segment " + curSegmentTxId +
+ ", " + getLastWrittenTxId());
Preconditions.checkState(isSegmentOpen(),
"Bad state: %s", state);
@@ -1372,7 +1381,10 @@ public class FSEditLog implements LogsPurgeable {
printStatistics(true);
final long lastTxId = getLastWrittenTxId();
-
+ final long lastSyncedTxId = getSyncTxId();
+ Preconditions.checkArgument(lastTxId == lastSyncedTxId,
+ "LastWrittenTxId %s is expected to be the same as lastSyncedTxId %s",
+ lastTxId, lastSyncedTxId);
try {
journalSet.finalizeLogSegment(curSegmentTxId, lastTxId);
editLogStream = null;
---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org