summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsueloverso <sue@mongodb.com>2017-01-15 20:31:47 -0500
committerAlex Gorrod <alexander.gorrod@mongodb.com>2017-01-16 12:31:47 +1100
commit36c9a6513bee481a7ef27f0696a88f9b1921c356 (patch)
tree0e2bc6018a86d6ccbdbf302d664d38f47cc08652
parentec9b2bd417be1fad7484335390385c2a669fc407 (diff)
downloadmongo-36c9a6513bee481a7ef27f0696a88f9b1921c356.tar.gz
WT-3114 Avoid archiving log files immediately after recovery. (#3238)
-rw-r--r--src/txn/txn_log.c16
-rw-r--r--test/suite/test_reconfig02.py1
-rw-r--r--test/suite/test_txn02.py4
-rw-r--r--test/suite/test_txn05.py6
4 files changed, 18 insertions, 9 deletions
diff --git a/src/txn/txn_log.c b/src/txn/txn_log.c
index 5f4704b40c4..7ad295f421b 100644
--- a/src/txn/txn_log.c
+++ b/src/txn/txn_log.c
@@ -368,14 +368,16 @@ __wt_txn_checkpoint_log(
/*
* If this full checkpoint completed successfully and there is
- * no hot backup in progress, tell the logging subsystem the
- * checkpoint LSN so that it can archive. Do not update the
- * logging checkpoint LSN if this is during a clean connection
- * close, only during a full checkpoint. A clean close may not
- * update any metadata LSN and we do not want to archive in
- * that case.
+ * no hot backup in progress and this is not recovery, tell
+ * the logging subsystem the checkpoint LSN so that it can
+ * archive. Do not update the logging checkpoint LSN if this
+ * is during a clean connection close, only during a full
+ * checkpoint. A clean close may not update any metadata LSN
+ * and we do not want to archive in that case.
*/
- if (!S2C(session)->hot_backup && txn->full_ckpt)
+ if (!S2C(session)->hot_backup &&
+ !F_ISSET(S2C(session), WT_CONN_RECOVERING) &&
+ txn->full_ckpt)
__wt_log_ckpt(session, ckpt_lsn);
/* FALLTHROUGH */
diff --git a/test/suite/test_reconfig02.py b/test/suite/test_reconfig02.py
index 36a78a1805f..8054b2a6ab5 100644
--- a/test/suite/test_reconfig02.py
+++ b/test/suite/test_reconfig02.py
@@ -109,6 +109,7 @@ class test_reconfig02(wttest.WiredTigerTestCase):
# Now turn on archive, sleep a bit to allow the archive thread
# to run and then confirm that all original logs are gone.
self.conn.reconfigure("log=(archive=true)")
+ self.session.checkpoint("force")
time.sleep(2)
cur_logs = fnmatch.filter(os.listdir('.'), "*Log*")
for o in orig_logs:
diff --git a/test/suite/test_txn02.py b/test/suite/test_txn02.py
index a0c2c12a47c..7c2a58516bc 100644
--- a/test/suite/test_txn02.py
+++ b/test/suite/test_txn02.py
@@ -176,8 +176,10 @@ class test_txn02(wttest.WiredTigerTestCase, suite_subprocess):
backup_conn = self.wiredtiger_open(self.backup_dir,
backup_conn_params)
try:
- self.check(backup_conn.open_session(), None, committed)
+ session = backup_conn.open_session()
finally:
+ session.checkpoint("force")
+ self.check(backup_conn.open_session(), None, committed)
# Sleep long enough so that the archive thread is guaranteed
# to run before we close the connection.
time.sleep(1.0)
diff --git a/test/suite/test_txn05.py b/test/suite/test_txn05.py
index 9e84fe7d3fe..5913c4688a3 100644
--- a/test/suite/test_txn05.py
+++ b/test/suite/test_txn05.py
@@ -139,8 +139,12 @@ class test_txn05(wttest.WiredTigerTestCase, suite_subprocess):
backup_conn = self.wiredtiger_open(self.backup_dir,
backup_conn_params)
try:
- self.check(backup_conn.open_session(), None, committed)
+ session = backup_conn.open_session()
finally:
+ self.check(session, None, committed)
+ # Force a checkpoint because we don't record the recovery
+ # checkpoint as available for archiving.
+ session.checkpoint("force")
# Sleep long enough so that the archive thread is guaranteed
# to run before we close the connection.
time.sleep(1.0)