summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorSusan LoVerso <sue@wiredtiger.com>2014-07-30 11:44:18 -0400
committerSusan LoVerso <sue@wiredtiger.com>2014-07-30 11:44:18 -0400
commit26c1134a6ad7db22ef1e27e6f6fe98b1a8503218 (patch)
tree9331be2fe36be120fb77fcc4e39bcae7eac5fd4b /examples
parentd69656ec25c4fa46084ae5f598ba4f9bd10aca57 (diff)
downloadmongo-26c1134a6ad7db22ef1e27e6f6fe98b1a8503218.tar.gz
Turn off archiving and close/reopen the connection so we see other types of log records.
Diffstat (limited to 'examples')
-rw-r--r--examples/c/ex_log.c18
1 files changed, 16 insertions, 2 deletions
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);