[
https://issues.apache.org/jira/browse/HBASE-1483?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12716490#action_12716490
]
stack commented on HBASE-1483:
------------------------------
I opened HBASE-1484 to fix order of edits in split files; they are newest to
oldest when should be reverse.
Here is what I committed to fix my original bad commit:
{code}
URL:
http://svn.apache.org/viewvc/hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/HLog.java?rev=781868&r1=781867&r2=781868&view=diff
==============================================================================
---
hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
(original)
+++
hadoop/hbase/branches/0.19/src/java/org/apache/hadoop/hbase/regionserver/HLog.java
Thu Jun 4 23:04:28 2009
@@ -785,13 +785,13 @@
// reports a zero length even if the file has been sync'd. Revisit
if
// HADOOP-4751 is committed.
long length = logfiles[i].getLen();
- HLogKey key = new HLogKey();
- HLogEdit val = new HLogEdit();
SequenceFile.Reader in = null;
try {
in = new SequenceFile.Reader(fs, logfiles[i].getPath(), conf);
try {
int count = 0;
+ HLogKey key = new HLogKey();
+ HLogEdit val = new HLogEdit();
while (in.next(key, val)) {
byte [] regionName = key.getRegionName();
LinkedList<HLogEntry> queue = logEntries.get(regionName);
@@ -802,6 +802,10 @@
}
queue.push(new HLogEntry(val, key));
count++;
+ // Make the key and value new each time; otherwise same
instance
+ // is used over and over.
+ key = new HLogKey();
+ val = new HLogEdit();
}
LOG.debug("Pushed " + count + " entries from " +
logfiles[i].getPath());
{code}
> HLog split loses track of edits
> -------------------------------
>
> Key: HBASE-1483
> URL: https://issues.apache.org/jira/browse/HBASE-1483
> Project: Hadoop HBase
> Issue Type: Bug
> Reporter: Clint Morgan
> Fix For: 0.20.0
>
> Attachments: 1483.patch
>
>
> HLog:803
> queue.push(new HLogEntry(val, key));
> The same val and key references are used in the iterator, so they keep
> changing their contents as we .next() through the loop.
> Thus, when we are done, all the HLogEntries in logEntries will have the same
> HLogEdits and HLogKeys! I don't think this would have ever worked unless
> there is only one region in the log being split.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.