Abhinaba Sarkar created RANGER-3766:
---------------------------------------
Summary: Connection issues during execution of db_setup.py wipes
shared DB
Key: RANGER-3766
URL: https://issues.apache.org/jira/browse/RANGER-3766
Project: Ranger
Issue Type: Bug
Components: admin
Affects Versions: 1.2.0
Reporter: Abhinaba Sarkar
Attachments: createrangerdb4.log
While running db_setup.py on a shared ranger DB (schema already present), if
there is an intermittent connection failure while executing the following lines
(351-354)-
{code:java}
isFirstTableExist = self.check_table(db_name, db_user, db_password,
first_table) isLastTableExist =
self.check_table(db_name, db_user, db_password, last_table)
isDBPatchesApplied=self.hasDBnJavaPatchesEntries(db_name,
db_user, db_password, "DB_PATCHES")
isJavaPatchesApplied=self.hasDBnJavaPatchesEntries(db_name, db_user,
db_password, "JAVA_PATCHES") {code}
the entire schema is re-imported and all the previous data is lost.
This happens because while executing the command through
{code:java}
check_output(){code}
method, we ignore the stderr. In case of any error since stdout is empty, the
code assumes that there is no existing schema and re-imports the schema file.
Issue found on version 1.2. Tested with MSSQL server on azure hdinsight
This issue can be reproduced by debugging using pdb and blocking connection to
the DB when executing the above lines. Logs attached.
--
This message was sent by Atlassian Jira
(v8.20.7#820007)