Commit 4865fa0e authored by Julien Muchembled's avatar Julien Muchembled

wip

parent 788b65f9
......@@ -519,9 +519,11 @@ class DatabaseManager(object):
if log == dropped:
dropped += 1
logging.info("dropping partition %s...", offset)
logging.debug('drop: pruneData(%s)', len(data_id_list))
drop_count += self._pruneData(data_id_list)
drop_time += time() - start
self.commit()
logging.debug('drop: committed')
self._drop_stats = drop_count, drop_time
if dropped:
logging.info("%s partition(s) dropped"
......
......@@ -409,10 +409,13 @@ class MySQLDatabaseManager(DatabaseManager):
q = self.query
where = " WHERE `partition`=%s ORDER BY tid, oid LIMIT %s" % (
offset, count)
logging.debug("drop: select(%s)", count)
x = q("SELECT data_id FROM obj USE INDEX(PRIMARY)" + where)
if x:
logging.debug("drop: obj")
q("DELETE FROM obj" + where)
return [x for x, in x if x]
logging.debug("drop: trans")
q("DELETE FROM trans WHERE `partition`=%s" % offset)
def _getUnfinishedDataIdList(self):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment