Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 0492B200CAE for ; Wed, 7 Jun 2017 02:06:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 038F5160BD3; Wed, 7 Jun 2017 00:06:32 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 26D8C160BC6 for ; Wed, 7 Jun 2017 02:06:31 +0200 (CEST) Received: (qmail 11753 invoked by uid 500); 7 Jun 2017 00:06:30 -0000 Mailing-List: contact notifications-help@asterixdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@asterixdb.apache.org Delivered-To: mailing list notifications@asterixdb.apache.org Received: (qmail 11744 invoked by uid 99); 7 Jun 2017 00:06:30 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Jun 2017 00:06:30 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id DE0DC1A0948 for ; Wed, 7 Jun 2017 00:06:29 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.92 X-Spam-Level: X-Spam-Status: No, score=0.92 tagged_above=-999 required=6.31 tests=[SPF_FAIL=0.919, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id pW2Se9gyxrOw for ; Wed, 7 Jun 2017 00:06:28 +0000 (UTC) Received: from unhygienix.ics.uci.edu (unhygienix.ics.uci.edu [128.195.14.130]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id BC4BC5FC57 for ; Wed, 7 Jun 2017 00:06:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by unhygienix.ics.uci.edu (Postfix) with ESMTP id 334FE240C2B; Tue, 6 Jun 2017 17:06:27 -0700 (PDT) Date: Tue, 6 Jun 2017 17:06:27 -0700 From: "Yingyi Bu (Code Review)" To: abdullah alamoudi CC: Jenkins , Murtadha Hubail , Ian Maxon , Till Westmann , Luo Chen Reply-To: buyingyi@gmail.com X-Gerrit-MessageType: comment Subject: Change in asterixdb[master]: Enable Component rollback in LSM Indexes X-Gerrit-Change-Id: I5fe10965734b60776100580c9568a0f954d6cb58 X-Gerrit-ChangeURL: X-Gerrit-Commit: 551ba212dbffe12b64cf4312f405ef26fbe0be4d In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 Message-Id: <20170607000627.334FE240C2B@unhygienix.ics.uci.edu> archived-at: Wed, 07 Jun 2017 00:06:32 -0000 Yingyi Bu has posted comments on this change. Change subject: Enable Component rollback in LSM Indexes ...................................................................... Patch Set 9: (13 comments) There are a couple of issues that I can think of. It's likely that I missed sth. 1. Can we use the similar mechanism to MERGE for deleting files/components? E.g., ILSMIndex.subsumeComponents(...) and inactiveDiskComponentsToBeDeleted in LSMHarness.exitComponents(...). It feels to me that all mechanisms are there. 2. Based on 1., it feels that IPageManager.clear() is not necessary. Why MERGE doesn't need IPageManager.clear()? https://asterix-gerrit.ics.uci.edu/#/c/1788/9/asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java File asterixdb/asterix-app/src/test/java/org/apache/asterix/test/dataflow/ComponentRollbackTest.java: PS9, Line 83: ComponentRollbackTest Fix all Thread.sleep(...) according to the sonar cube suggestion? https://asterix-gerrit.ics.uci.edu/#/c/1788/9/asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/CorrelatedPrefixMergePolicy.java File asterixdb/asterix-common/src/main/java/org/apache/asterix/common/context/CorrelatedPrefixMergePolicy.java: PS9, Line 280: || immutableComponents.get(i).getState() == ComponentState.DECOMMISSIONING why decommissioning implies isMergeOngoing==true? https://asterix-gerrit.ics.uci.edu/#/c/1788/9/hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/utils/IoUtil.java File hyracks-fullstack/hyracks/hyracks-control/hyracks-control-nc/src/main/java/org/apache/hyracks/control/nc/utils/IoUtil.java: PS9, Line 19: control.nc move this to hyracks-util? https://asterix-gerrit.ics.uci.edu/#/c/1788/9/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMMemoryComponent.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/AbstractLSMMemoryComponent.java: PS9, Line 121: IllegalStateException Error code? PS9, Line 125: Error code? https://asterix-gerrit.ics.uci.edu/#/c/1788/9/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/ConstantMergePolicy.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/ConstantMergePolicy.java: PS9, Line 138: immutableComponents.get(i).getState() == ComponentState.DECOMMISSIONING The code reads weird: immutableComponents.get(i).getState() == ComponentState.DECOMMISSIONING implies isMergeOngoing == true https://asterix-gerrit.ics.uci.edu/#/c/1788/9/hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java File hyracks-fullstack/hyracks/hyracks-storage-am-lsm-common/src/main/java/org/apache/hyracks/storage/am/lsm/common/impls/LSMHarness.java: PS9, Line 217: failedOperation pull if(failedOperation) out to reduce nested levels. PS9, Line 261: if (opType == LSMOperationType.ROLLBACK) { Move the if branch to be CASE in side the next switch(opType)? PS9, Line 262: lsmIndex.getDiskComponents().remove(c); Do that inside lsmIndex so that readers can easily track which component(s) is(are) removed. For example, add a new method called removeDiskComponent(ILSMDiskComponent c) into the ILSMIndex interface. PS9, Line 496: if (newComponent != null) reverse the if condition to reduce nesting levels. PS9, Line 690: rollback change the method name to logRollback()? PS9, Line 686: try { : for (ILSMComponent c : ctx.getComponentHolder()) { : if (c.getType() == LSMComponentType.DISK) { : // persist rollback in case of crash : ((ILSMDiskComponent) c).rollback(); : } : } : } Creating a shadow file does not need to be within synchronized(opTracker). PS9, Line 693: finally { : exitComponents(ctx, LSMOperationType.ROLLBACK, null, false); : } exitComponents(...) shouldn't under the umbrella of synchronized(opTracker) -- To view, visit https://asterix-gerrit.ics.uci.edu/1788 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5fe10965734b60776100580c9568a0f954d6cb58 Gerrit-PatchSet: 9 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: abdullah alamoudi Gerrit-Reviewer: Ian Maxon Gerrit-Reviewer: Jenkins Gerrit-Reviewer: Luo Chen Gerrit-Reviewer: Murtadha Hubail Gerrit-Reviewer: Till Westmann Gerrit-Reviewer: Yingyi Bu Gerrit-Reviewer: abdullah alamoudi Gerrit-HasComments: Yes