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 6A386200AF2 for ; Wed, 4 May 2016 08:03:15 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 68A191609F7; Wed, 4 May 2016 08:03:15 +0200 (CEST) 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 825D71609F8 for ; Wed, 4 May 2016 08:03:14 +0200 (CEST) Received: (qmail 82446 invoked by uid 500); 4 May 2016 06:03:13 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 82434 invoked by uid 99); 4 May 2016 06:03:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 May 2016 06:03:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D7A8B2C1F61 for ; Wed, 4 May 2016 06:03:12 +0000 (UTC) Date: Wed, 4 May 2016 06:03:12 +0000 (UTC) From: "Nitiraj Singh Rathore (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-16242) Hive View and Pig View : one user overriding job details of other user in database MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 04 May 2016 06:03:15 -0000 [ https://issues.apache.org/jira/browse/AMBARI-16242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Nitiraj Singh Rathore updated AMBARI-16242: ------------------------------------------- Description: Steps to reproduce. 0. create a new hive view for better understanding. Note the table names created in DB for this instance. 1. Login with user one (admin). 2. execute one hive query 3. go to database and note the new entries in ds_jobimpl_ and dsf_storedoperationhandle_ tables. 4. Login in with another use say (testUser) 5. execute one hive query 6. go to database and check the entries in ds_jobimpl_ and dsf_storedoperationhandle_ tables. you will find that the entries of admin were overridden by queries of testUser instead of creating 2 separate entries. Reason : For creating any entity in database. Hive and Pig view are generating the IDs in the code itself. The code that generates IDs is wrong. It keeps a key for each entity and increments the counter for it for next entity. This key value pair is stored in context.putInstanceData. This instance data is inherently User dependent. So there is separate counter for each user. But the tables ds_jobimpl etc of hive and pig assumes unique ID across all users. So the queries of one user are getting overridden by another. Implications : The implications of this can be very bad. The effects will be not very visible if users execute queries serially but if they execute queries simultaneously then on the fly the users will keep replacing the entries which have state session data and operation handle of each other and will results in many exceptions and errors. Probably, many of the current exceptions of hive view might be because of this bug. was: Steps to reproduce. 0. create a new hive view for better understanding. Note the table names created in DB for this instance. 1. Login with user one (admin). 2. execute one hive query 3. go to database and note the new entries in ds_jobimpl_ and dsf_storedoperationhandle_ tables. 4. Login in with another use say (testUser) 5. execute one hive query 6. go to database and check the entries in ds_jobimpl_ and dsf_storedoperationhandle_ tables. you will find that the entries of admin were overridden by queries of testUser instead of creating 2 separate entries. Reason : For creating any entity in database. Hive and Pig view are generating the IDs in the code itself. The code that generates IDs is wrong. It keeps a key for each entity and increments the counter for it for next entity. This key value pair is stored in context.putInstanceData. This instance data is inherently User dependent. So there is separate counter for each user. But the tables ds_jobimpl etc of hive and pig assumes unique ID across all users. So the queries of one user are getting overridden by another. Implications : The implications of this can be very bad. The results will be not very visible if users execute queries serially but if they execute queries simultaneously then on the fly the users will keep replacing the entries which have state session data and operation handle of each other and will results in many exceptions and errors. Probably, many of the current exceptions of hive view might be because of this bug. > Hive View and Pig View : one user overriding job details of other user in database > ---------------------------------------------------------------------------------- > > Key: AMBARI-16242 > URL: https://issues.apache.org/jira/browse/AMBARI-16242 > Project: Ambari > Issue Type: Bug > Components: ambari-views > Affects Versions: 2.2.2 > Reporter: Nitiraj Singh Rathore > Assignee: Nitiraj Singh Rathore > Fix For: 2.4.0 > > > Steps to reproduce. > 0. create a new hive view for better understanding. Note the table names created in DB for this instance. > 1. Login with user one (admin). > 2. execute one hive query > 3. go to database and note the new entries in ds_jobimpl_ and dsf_storedoperationhandle_ tables. > 4. Login in with another use say (testUser) > 5. execute one hive query > 6. go to database and check the entries in ds_jobimpl_ and dsf_storedoperationhandle_ tables. > you will find that the entries of admin were overridden by queries of testUser instead of creating 2 separate entries. > Reason : > For creating any entity in database. Hive and Pig view are generating the IDs in the code itself. > The code that generates IDs is wrong. It keeps a key for each entity and increments the counter for it for next entity. This key value pair is stored in context.putInstanceData. > This instance data is inherently User dependent. So there is separate counter for each user. But the tables ds_jobimpl etc of hive and pig assumes unique ID across all users. So the queries of one user are getting overridden by another. > Implications : > The implications of this can be very bad. The effects will be not very visible if users execute queries serially but if they execute queries simultaneously then on the fly the users will keep replacing the entries which have state session data and operation handle of each other and will results in many exceptions and errors. > Probably, many of the current exceptions of hive view might be because of this bug. -- This message was sent by Atlassian JIRA (v6.3.4#6332)