Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@

public class CatalogRecycleBin extends MasterDaemon implements Writable {
private static final Logger LOG = LogManager.getLogger(CatalogRecycleBin.class);
// erase meta at least after minEraseLatency milliseconds
// to avoid erase log ahead of drop log
private static final long minEraseLatency = 10 * 60 * 1000; // 10 min

private Map<Long, RecycleDatabaseInfo> idToDatabase;
private Map<Long, RecycleTableInfo> idToTable;
Expand Down Expand Up @@ -130,10 +133,8 @@ public synchronized boolean recyclePartition(long dbId, long tableId, Partition
}

private synchronized boolean isExpire(long id, long currentTimeMs) {
if (currentTimeMs - idToRecycleTime.get(id) > Config.catalog_trash_expire_second * 1000L) {
return true;
}
return false;
long latency = currentTimeMs - idToRecycleTime.get(id);
return latency > minEraseLatency && latency > Config.catalog_trash_expire_second * 1000L;
}

private synchronized void eraseDatabase(long currentTimeMs) {
Expand Down