phoenix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sama...@apache.org
Subject phoenix git commit: PHOENIX-2506 UPDATE STATS could end up updating incomplete/incorrect stats in case of failures
Date Thu, 10 Dec 2015 00:36:11 GMT
Repository: phoenix
Updated Branches:
  refs/heads/4.x-HBase-1.0 da165b359 -> dbd697eb3


PHOENIX-2506 UPDATE STATS could end up updating incomplete/incorrect stats in case of failures


Project: http://git-wip-us.apache.org/repos/asf/phoenix/repo
Commit: http://git-wip-us.apache.org/repos/asf/phoenix/commit/dbd697eb
Tree: http://git-wip-us.apache.org/repos/asf/phoenix/tree/dbd697eb
Diff: http://git-wip-us.apache.org/repos/asf/phoenix/diff/dbd697eb

Branch: refs/heads/4.x-HBase-1.0
Commit: dbd697eb3cdf40e1da717058b7d2fddaecc7aabb
Parents: da165b3
Author: Samarth <samarth@apache.org>
Authored: Wed Dec 9 16:36:03 2015 -0800
Committer: Samarth <samarth@apache.org>
Committed: Wed Dec 9 16:36:03 2015 -0800

----------------------------------------------------------------------
 .../phoenix/coprocessor/UngroupedAggregateRegionObserver.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/phoenix/blob/dbd697eb/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
----------------------------------------------------------------------
diff --git a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
index 57df353..4325760 100644
--- a/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
+++ b/phoenix-core/src/main/java/org/apache/phoenix/coprocessor/UngroupedAggregateRegionObserver.java
@@ -278,6 +278,8 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver{
         long rowCount = 0;
         final RegionScanner innerScanner = theScanner;
         region.startRegionOperation();
+        boolean updateStats = stats != null;
+        boolean success = false;
         try {
             synchronized (innerScanner) {
                 do {
@@ -286,7 +288,7 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver{
                     // since this is an indication of whether or not there are more values
after the
                     // ones returned
                     hasMore = innerScanner.nextRaw(results);
-                    if (stats != null) {
+                    if (updateStats) {
                         stats.collectStatistics(results);
                     }
                     if (!results.isEmpty()) {
@@ -516,10 +518,11 @@ public class UngroupedAggregateRegionObserver extends BaseScannerRegionObserver{
                         hasAny = true;
                     }
                 } while (hasMore);
+                success = true;
             }
         } finally {
             try {
-                if (stats != null) {
+                if (success && updateStats) {
                     try {
                         stats.updateStatistic(region);
                     } finally {


Mime
View raw message