Uploaded image for project: 'Hive'
  1. Hive
  2. HIVE-11488

Add sessionId and queryId info to HS2 log


    • Type: New Feature
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: Logging
    • Labels:
    • Target Version/s:


      Session is critical for a multi-user system like Hive. Currently Hive doesn't log seessionId to the log file, which sometimes make debugging and analysis difficult when multiple activities are going on at the same time and the log from different sessions are mixed together.

      Currently, Hive already has the sessionId saved in SessionState and also there is another sessionId in SessionHandle (Seems not used and I'm still looking to understand it). Generally we should have one sessionId from the beginning in the client side and server side. Seems we have some work on that side first.

      The sessionId then can be added to log4j supported mapped diagnostic context (MDC) and can be configured to output to log file through the log4j property. MDC is per thread, so we need to add sessionId to the HS2 main thread and then it will be inherited by the child threads.


        1. HIVE-11488.3.patch
          8 kB
          Aihua Xu
        2. HIVE-11488.2.patch
          11 kB
          Aihua Xu
        3. HIVE-11488.patch
          6 kB
          Aihua Xu

          Issue Links



              • Assignee:
                aihuaxu Aihua Xu
                aihuaxu Aihua Xu
              • Votes:
                0 Vote for this issue
                10 Start watching this issue


                • Created: