Repository: incubator-trafodion Updated Branches: refs/heads/master aa2681f26 -> e1c12dd31
TRAFODION-1910 mxosrvr crashes on Hive query after reconnect (take 2) NATableDB is caching a pointer to a HiveClient_JNI object (HiveMetaData::client_), but that object gets deallocated when a JDBC client disconnects. Fixing this by keeping the HiveClient_JNI around across sessions. Selva and Suresh commented on the first fix and suggested to treat both HBaseClient_JNI and HiveClient_JNI the same and to remove the CLI interface that's used to delete these objects. Therefore, the new fix is to remove this CLI call. It gets called from two places, one is when an ODBC/JDBC connection closes and the other is from "initialize trafodion, drop". We believe that neither of them is needed. Note that we have only one object of each type per CLI context, and that we delete both objects when we delete the context (ContextCli::deleteMe()), so there are no leaks. Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/841321a5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/841321a5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/841321a5 Branch: refs/heads/master Commit: 841321a57d03343faf7d894ff8987ea677bde05b Parents: 70b17ed Author: Hans Zeller <[email protected]> Authored: Thu Mar 31 00:08:50 2016 +0000 Committer: Hans Zeller <[email protected]> Committed: Thu Mar 31 00:08:50 2016 +0000 ---------------------------------------------------------------------- core/sql/arkcmp/CmpStatement.cpp | 2 -- core/sql/cli/CliExtern.cpp | 36 --------------------------- core/sql/cli/SQLCLIdev.h | 2 -- core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp | 2 -- 4 files changed, 42 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/841321a5/core/sql/arkcmp/CmpStatement.cpp ---------------------------------------------------------------------- diff --git a/core/sql/arkcmp/CmpStatement.cpp b/core/sql/arkcmp/CmpStatement.cpp index 377c33d..3eb0ecf 100644 --- a/core/sql/arkcmp/CmpStatement.cpp +++ b/core/sql/arkcmp/CmpStatement.cpp @@ -1311,8 +1311,6 @@ CmpStatement::process (const CmpMessageEndSession& es) CURRENTQCACHE->makeEmpty(); } - SQL_EXEC_DeleteHbaseJNI(); - return CmpStatement_SUCCESS; } http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/841321a5/core/sql/cli/CliExtern.cpp ---------------------------------------------------------------------- diff --git a/core/sql/cli/CliExtern.cpp b/core/sql/cli/CliExtern.cpp index e5dd796..201c257 100644 --- a/core/sql/cli/CliExtern.cpp +++ b/core/sql/cli/CliExtern.cpp @@ -89,7 +89,6 @@ CLISemaphore globalSemaphore ; #include "SqlStats.h" #include "ComExeTrace.h" #include "Context.h" -#include "HBaseClient_JNI.h" #ifndef CLI_PRIV_SRL @@ -6301,41 +6300,6 @@ Lng32 SQL_EXEC_ResetParserFlagsForExSqlComp_Internal2(ULng32 flagbits) return retcode; } -Lng32 SQL_EXEC_DeleteHbaseJNI() -{ - Lng32 retcode; - CLISemaphore *tmpSemaphore; - ContextCli *threadContext; - - CLI_NONPRIV_PROLOGUE(retcode); - - try - { - tmpSemaphore = getCliSemaphore(threadContext); - tmpSemaphore->get(); - threadContext->incrNumOfCliCalls(); - - HBaseClient_JNI::deleteInstance(); - HiveClient_JNI::deleteInstance(); - } - catch(...) - { - retcode = -CLI_INTERNAL_ERROR; -#if defined(_THROW_EXCEPTIONS) - if (cliWillThrow()) - { - threadContext->decrNumOfCliCalls(); - tmpSemaphore->release(); - throw; - } -#endif - } - threadContext->decrNumOfCliCalls(); - tmpSemaphore->release(); - - return retcode; -} - //LCOV_EXCL_START // For internal use only -- do not document! SQLCLI_LIB_FUNC const char *const *const http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/841321a5/core/sql/cli/SQLCLIdev.h ---------------------------------------------------------------------- diff --git a/core/sql/cli/SQLCLIdev.h b/core/sql/cli/SQLCLIdev.h index 996540a..8cf2bde 100644 --- a/core/sql/cli/SQLCLIdev.h +++ b/core/sql/cli/SQLCLIdev.h @@ -83,8 +83,6 @@ Lng32 SQL_EXEC_AssignParserFlagsForExSqlComp_Internal( Lng32 SQL_EXEC_GetParserFlagsForExSqlComp_Internal( /*IN*/ ULng32 &flagbits); -Lng32 SQL_EXEC_DeleteHbaseJNI(); - // For internal use only -- do not document! SQLCLI_LIB_FUNC short SQL_EXEC_GetDefaultVolume_Internal( /*OUT*/ char outBuf[], http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/841321a5/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp ---------------------------------------------------------------------- diff --git a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp index c17b5ed..d4ce251 100644 --- a/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp +++ b/core/sql/sqlcomp/CmpSeabaseDDLcommon.cpp @@ -7625,8 +7625,6 @@ void CmpSeabaseDDL::dropSeabaseMD(NABoolean ddlXns) // drop all objects that match the pattern "TRAFODION.*" dropSeabaseObjectsFromHbase("TRAFODION\\..*", ddlXns); - SQL_EXEC_DeleteHbaseJNI(); - //drop all lob data and descriptor files dropLOBHdfsFiles();
