From 26c1134a6ad7db22ef1e27e6f6fe98b1a8503218 Mon Sep 17 00:00:00 2001 From: Susan LoVerso Date: Wed, 30 Jul 2014 11:44:18 -0400 Subject: Turn off archiving and close/reopen the connection so we see other types of log records. --- examples/c/ex_log.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/c/ex_log.c b/examples/c/ex_log.c index 581338277e2..61c2510a5db 100644 --- a/examples/c/ex_log.c +++ b/examples/c/ex_log.c @@ -39,7 +39,7 @@ const char *home = "./WT_EXLOG"; const char *home2 = "./WT_EXLOG2"; const char *uri = "table:logtest"; -#define CONN_CONFIG "create,cache_size=100MB,log=(enabled=true)" +#define CONN_CONFIG "create,cache_size=100MB,log=(archive=false,enabled=true)" #define MAX_KEYS 10 #define WALK_PRINT(lsn) \ @@ -202,7 +202,7 @@ step_log(WT_SESSION *session) /* * If the operation is a put, replay it here on the backup * connection. Note, we cheat by looking only for fileid 1 - * in this example. Fileid 0 is the metadata. + * in this example. The metadata is fileid 0. */ if (fileid == 1 && rectype == WT_LOGREC_COMMIT && optype == WT_LOGOP_ROW_PUT) { @@ -310,6 +310,20 @@ int main(void) ret = session->commit_transaction(session, NULL); cursor->close(cursor); + /* + * Close and reopen the connection so that the log ends up with + * a variety of records such as file sync and checkpoint. We + * have archiving turned off. + */ + ret = wt_conn->close(wt_conn, NULL); + if ((ret = wiredtiger_open(home, NULL, + CONN_CONFIG, &wt_conn)) != 0) { + fprintf(stderr, "Error connecting to %s: %s\n", + home, wiredtiger_strerror(ret)); + return (ret); + } + ret = wt_conn->open_session(wt_conn, NULL, NULL, &session); + ret = walk_log(session); ret = step_log(session); -- cgit v1.2.1