HBASE-6065 Log for flush would append a non-sequential edit in the hlog, leading to possible data loss (Chunhui)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1342019 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-05-23 20:17:44 +00:00
parent dfc63998d2
commit be6e4c6593
1 changed files with 9 additions and 2 deletions

View File

@ -1303,8 +1303,15 @@ public class HLogSplitter {
* Update region's maximum edit log SeqNum.
*/
void updateRegionMaximumEditLogSeqNum(Entry entry) {
regionMaximumEditLogSeqNum.put(entry.getKey().getEncodedRegionName(),
entry.getKey().getLogSeqNum());
synchronized (regionMaximumEditLogSeqNum) {
Long currentMaxSeqNum=regionMaximumEditLogSeqNum.get(entry.getKey().getEncodedRegionName());
if (currentMaxSeqNum == null
|| entry.getKey().getLogSeqNum() > currentMaxSeqNum) {
regionMaximumEditLogSeqNum.put(entry.getKey().getEncodedRegionName(),
entry.getKey().getLogSeqNum());
}
}
}
Long getRegionMaximumEditLogSeqNum(byte[] region) {