From c6286c03841e9f3fa5f2040392e1c1521a89f0f6 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Wed, 28 Jun 2017 19:50:55 +0200 Subject: [PATCH] F #4809: Safer purge function for RAFT log --- src/sql/LogDB.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sql/LogDB.cc b/src/sql/LogDB.cc index 7fb34fb608..99895f09c9 100644 --- a/src/sql/LogDB.cc +++ b/src/sql/LogDB.cc @@ -531,7 +531,7 @@ int LogDB::purge_log() return 0; } - unsigned int delete_index = last_index - log_retention; + unsigned int delete_index = last_applied - log_retention; // keep the last "log_retention" records as well as those not applied to DB oss << "DELETE FROM logdb WHERE timestamp > 0 AND log_index >= 0 "