Project: datamanagement
Issue DM-2417: Data loader script crashes trying to create chunk table
Vaikunth discovered a bug in data loader when trying to load a data into Object table: {noformat} [CRITICAL] root: Exception occured: Table 'Object_7480' already exists Traceback (most recent call last): File "/usr/local/home/vaikunth/src/qserv/bin/qserv-data-loader.py", line 318, in sys.exit(loader.run()) File "/usr/local/home/vaikunth/src/qserv/bin/qserv-data-loader.py", line 254, in run self.loader.load(self.args.database, self.args.table, self.args.schema, self.args.data) File "/usr/local/home/vaikunth/src/qserv/lib/python/lsst/qserv/admin/dataLoader.py", line 171, in load return self._run(database, table, schema, data) File "/usr/local/home/vaikunth/src/qserv/lib/python/lsst/qserv/admin/dataLoader.py", line 209, in _run self._loadData(database, table, files) File "/usr/local/home/vaikunth/src/qserv/lib/python/lsst/qserv/admin/dataLoader.py", line 586, in _loadData self._loadChunkedData(database, table) File "/usr/local/home/vaikunth/src/qserv/lib/python/lsst/qserv/admin/dataLoader.py", line 653, in _loadChunkedData self._makeChunkAndOverlapTable(conn, database, table, chunkId) File "/usr/local/home/vaikunth/src/qserv/lib/python/lsst/qserv/admin/dataLoader.py", line 727, in _makeChunkAndOverlapTable cursor.execute(q) File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 176, in execute if not self._defer_warnings: self._warning_check() File "build/bdist.linux-x86_64/egg/MySQLdb/cursors.py", line 92, in _warning_check warn(w[-1], self.Warning, 3) Warning: Table 'Object_7480' already exists {noformat} It looks like I did not do enough testing after my recent improvement in creating chunk tables. It tries to create the chunk table with "CREATE TABLE IF NOT EXISTS ..." but that actually generates "warning exception" on mysql side when table is already there. Need to catch this exception and ignore it.
Story points: 1