Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 524C510743 for ; Tue, 25 Feb 2014 04:27:39 +0000 (UTC) Received: (qmail 2418 invoked by uid 500); 25 Feb 2014 04:27:32 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 2285 invoked by uid 500); 25 Feb 2014 04:27:31 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 2179 invoked by uid 99); 25 Feb 2014 04:27:29 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Feb 2014 04:27:29 +0000 Date: Tue, 25 Feb 2014 04:27:29 +0000 (UTC) From: "Hudson (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HBASE-10556) Possible data loss due to non-handled DroppedSnapshotException for user-triggered flush from client/shell MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-10556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13911233#comment-13911233 ] Hudson commented on HBASE-10556: -------------------------------- SUCCESS: Integrated in HBase-0.98 #182 (See [https://builds.apache.org/job/HBase-0.98/182/]) HBASE-10556 Possible data loss due to non-handled DroppedSnapshotException for user-triggered flush from client/shell (stack: rev 1571502) * /hbase/branches/0.98/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java > Possible data loss due to non-handled DroppedSnapshotException for user-triggered flush from client/shell > --------------------------------------------------------------------------------------------------------- > > Key: HBASE-10556 > URL: https://issues.apache.org/jira/browse/HBASE-10556 > Project: HBase > Issue Type: Bug > Components: regionserver > Reporter: Feng Honghua > Assignee: Feng Honghua > Priority: Critical > Fix For: 0.96.2, 0.98.1, 0.99.0 > > Attachments: HBASE-10556-trunk_v1.patch > > > During the code review when investigating HBASE-10499, a possibility of data loss due to non-handled DroppedSnapshotException for user-triggered flush is exposed. > Data loss can happen as below: > # A flush for some region is triggered via HBaseAdmin or shell > # The request reaches regionserver and eventually HRegion.internalFlushcache is called, then fails at persisting memstore's snapshot to hfile, DroppedSnapshotException is thrown and the snapshot is left not cleared. > # DroppedSnapshotException is not handled in HRegion, and is just encapsulated as a ServiceException before returning to client > # After a while, some new writes are handled and put in the current memstore, then a new flush is triggered for the region due to memstoreSize exceeds flush threshold > # This second(new) flush succeeds, for the HStore which failed in the previous user-triggered flush, the remained non-empty snapshot is used rather than a new snapshot made from the current memstore, but HLog's latest sequenceId is used for the resultant hfiles --- the sequenceId attached within the hfiles says all edits with sequenceId <= it have all been persisted, but actually it's not the truth for the edits still in the existing memstore > # Now the regionserver hosting this region dies > # During the replay phase of failover, the edits corresponding to the ones while are in memstore and not actually persisted in hfiles when the previous regionserver dies will be ignored, since they are deemed as persisted by compared to the hfiles' latest consequenceID --- These edits are lost... > For the second flush, we also can't discard the remained snapshot and make a new one using current memstore, that way the data in the remained snapshot is lost. We should abort the regionserver immediately and rely on the failover to replay the log for data safety. > DroppedSnapshotException is correctly handled in MemStoreFlusher for internally triggered flush (which are generated by flush-size / rollWriter / periodicFlusher). But user-triggered flush is processed directly by HRegionServer->HRegion without putting a flush entry to flushQueue, hence not handled by MemStoreFlusher -- This message was sent by Atlassian JIRA (v6.1.5#6160)