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 3B84D200D24 for ; Tue, 24 Oct 2017 23:17:32 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 3A014160BDB; Tue, 24 Oct 2017 21:17: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 A5EE71609C8 for ; Tue, 24 Oct 2017 23:17:31 +0200 (CEST) Received: (qmail 43886 invoked by uid 500); 24 Oct 2017 21:17:30 -0000 Mailing-List: contact dev-help@phoenix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@phoenix.apache.org Delivered-To: mailing list dev@phoenix.apache.org Received: (qmail 43874 invoked by uid 99); 24 Oct 2017 21:17:30 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 24 Oct 2017 21:17:30 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 20A03DFB0E; Tue, 24 Oct 2017 21:17:28 +0000 (UTC) From: karanmehta93 To: dev@phoenix.apache.org Reply-To: dev@phoenix.apache.org References: In-Reply-To: Subject: [GitHub] phoenix pull request #277: PHOENIX-3757 System mutex table not being created... Content-Type: text/plain Message-Id: <20171024211729.20A03DFB0E@git1-us-west.apache.org> Date: Tue, 24 Oct 2017 21:17:28 +0000 (UTC) archived-at: Tue, 24 Oct 2017 21:17:32 -0000 Github user karanmehta93 commented on a diff in the pull request: https://github.com/apache/phoenix/pull/277#discussion_r146695278 --- Diff: phoenix-core/src/main/java/org/apache/phoenix/coprocessor/MetaDataProtocol.java --- @@ -95,6 +97,7 @@ // Key is the SYSTEM.CATALOG timestamp for the version and value is the version string. private static final NavigableMap TIMESTAMP_VERSION_MAP = new TreeMap<>(); static { + TIMESTAMP_VERSION_MAP.put(MIN_SYSTEM_TABLE_MIGRATION_TIMESTAMP, MIGRATION_IN_PROGRESS); --- End diff -- Nope, this one is not only for test. When you acquire a lock on SYSMUTEX, the method requires you to pass in a server side timestamp of SYSCAT table (Since it was meant for that earlier) and it checks if the current timestamp is less than the MIN_SYSTEM_TABLE_TIMESTAMP before upgrading it. I can't use MIN_SYSTEM_TABLE_TIMESTAMP because then the code for `acquireUpgradeMutex()` wont allow me to acquire the mutex lock. I use the same `UpgradeInProgressException` to prevent multiple clients migrating the system tables together. I use this value in `UpgradeInProgressException` to change the error message displayed to the user. ---