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:
parent
dfc63998d2
commit
be6e4c6593
|
@ -1303,9 +1303,16 @@ public class HLogSplitter {
|
|||
* Update region's maximum edit log SeqNum.
|
||||
*/
|
||||
void updateRegionMaximumEditLogSeqNum(Entry entry) {
|
||||
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) {
|
||||
return regionMaximumEditLogSeqNum.get(region);
|
||||
|
|
Loading…
Reference in New Issue