You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by kkhatua <gi...@git.apache.org> on 2017/12/20 18:32:47 UTC

[GitHub] drill pull request #1076: DRILL-6036: Create sys.connections table

GitHub user kkhatua opened a pull request:

    https://github.com/apache/drill/pull/1076

    DRILL-6036: Create sys.connections table

    Introduced a distributed (i.e. each Drillbit executes a fragment) system table to list all the active client connections to all the Drillbits in a cluster. This is achieved by having the UserServer maintain a static (class-level) map of these connections, which is updated as and when connections are established and closed.
    
    The following details are provided by the table:
        user
        targetUser
        client
        drillbit
        established
        duration
        queries
        isAuthenticated
        isEncrypted
        usingSSL
        session
    
    A sample run shows the following:
    ```
    [root@kk190 ~]# /opt/mapr/drill/apache-drill-1.13.0/bin/sqlline -u "jdbc:drill:drillbit=`hostname -i`" -n kunal
    ...
    apache drill 1.13.0-SNAPSHOT 
    "just drill it"
    0: jdbc:drill:drillbit=10.10.106.190> select * from sys.connections;
    +------------+-------------+----------------+---------------+--------------------------+------------+----------+------------------+--------------+-----------+---------------------------------------+
    |    user    | targetUser  |     client     |   drillbit    |       established        |  duration  | queries  | isAuthenticated  | isEncrypted  | usingSSL  |                session                |
    +------------+-------------+----------------+---------------+--------------------------+------------+----------+------------------+--------------+-----------+---------------------------------------+
    | anonymous  | anonymous   | 10.10.106.190  | kk190.qa.lab  | 2017-12-20 10:27:30.377  | 5.189 sec  | 1        | false            | false        | false     | b95e76ab-be51-4dde-9554-4d31a36e47a5  |
    +------------+-------------+----------------+---------------+--------------------------+------------+----------+------------------+--------------+-----------+---------------------------------------+
    1 row selected (0.163 seconds)
    ```

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/kkhatua/drill DRILL-6036

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/drill/pull/1076.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1076
    
----
commit 3cff0ec8f126f9c8f26ec1b1e4d07a31e553993c
Author: Kunal Khatua <kk...@...>
Date:   2017-12-20T18:28:15Z

    DRILL-6036: Create sys.connections table
    
    Introduced a distributed (i.e. each Drillbit executes a fragment) system table to list all the active client connections to all the Drillbits in a cluster. This is achieved by having the UserServer maintain a static (class-level) map of these connections, which is updated as and when connections are established and closed.
    
    The following details are provided by the table:
        user
        targetUser
        client
        drillbit
        established
        duration
        queries
        isAuthenticated
        isEncrypted
        usingSSL
        session

----


---

[GitHub] drill issue #1076: DRILL-6036: Create sys.connections table

Posted by sohami <gi...@git.apache.org>.
Github user sohami commented on the issue:

    https://github.com/apache/drill/pull/1076
  
    Filtering should be done based on impersonated user which will be stored in UserSession as well. So your check [here](https://github.com/kkhatua/drill/blob/66ab15df7e0df6804b1938adc048728c7436450b/exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/BitToUserConnectionIterator.java#L81) is fine.
    
    But we shouldn't display the [target User](https://github.com/kkhatua/drill/blob/66ab15df7e0df6804b1938adc048728c7436450b/exec/java-exec/src/main/java/org/apache/drill/exec/store/sys/BitToUserConnectionIterator.java#L123) separately in the table. Just displaying the session user is fine which will be same as querying user. Because when we do `session.getTargetUserName()`  it get's the target name which was passed in Connection URL during connection time. But during query time the actual targeted user or the session user can change.
    



---

[GitHub] drill issue #1076: DRILL-6036: Create sys.connections table

Posted by parthchandra <gi...@git.apache.org>.
Github user parthchandra commented on the issue:

    https://github.com/apache/drill/pull/1076
  
    +1 (binding)


---

[GitHub] drill issue #1076: DRILL-6036: Create sys.connections table

Posted by parthchandra <gi...@git.apache.org>.
Github user parthchandra commented on the issue:

    https://github.com/apache/drill/pull/1076
  
    +1. Nice work.


---

[GitHub] drill pull request #1076: DRILL-6036: Create sys.connections table

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/drill/pull/1076


---

[GitHub] drill issue #1076: DRILL-6036: Create sys.connections table

Posted by sohami <gi...@git.apache.org>.
Github user sohami commented on the issue:

    https://github.com/apache/drill/pull/1076
  
    +1 LGTM. Thanks for the changes.


---

[GitHub] drill issue #1076: DRILL-6036: Create sys.connections table

Posted by kkhatua <gi...@git.apache.org>.
Github user kkhatua commented on the issue:

    https://github.com/apache/drill/pull/1076
  
    @sohami updated the commit. Please review.


---

[GitHub] drill issue #1076: DRILL-6036: Create sys.connections table

Posted by kkhatua <gi...@git.apache.org>.
Github user kkhatua commented on the issue:

    https://github.com/apache/drill/pull/1076
  
    @parthchandra I've added the same security check being done for DRILL-5068. But I'm not sure if the match for connections should be in the original user or the impersonated user, or both. Suggestions? 


---