diff options
author | Susan LoVerso <sue@wiredtiger.com> | 2014-11-14 16:24:07 -0500 |
---|---|---|
committer | Susan LoVerso <sue@wiredtiger.com> | 2014-11-14 16:24:07 -0500 |
commit | 46af2c8589103dbd56901ccd96d136c7ce768e56 (patch) | |
tree | 4dc3e35727b9ad3619f19466d37338fc45942c39 /examples | |
parent | 564ef69d979e0aef9992c9f9737e945530f1306a (diff) | |
download | mongo-46af2c8589103dbd56901ccd96d136c7ce768e56.tar.gz |
Update backup documentation. #1183
Diffstat (limited to 'examples')
-rw-r--r-- | examples/c/ex_backup.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/examples/c/ex_backup.c b/examples/c/ex_backup.c index 2d4489dd968..c3e09add703 100644 --- a/examples/c/ex_backup.c +++ b/examples/c/ex_backup.c @@ -251,9 +251,11 @@ take_incr_backup(WT_SESSION *session, int i) if (ret != WT_NOTFOUND) fprintf(stderr, "WT_CURSOR.next: %s\n", wiredtiger_strerror(ret)); + ret = 0; /* * With an incremental cursor, we want to truncate on the backup - * cursor to archive the logs. + * cursor to archive the logs. Only do this if the copy process + * was entirely successful. */ ret = session->truncate(session, "log:", cursor, NULL, NULL); ret = cursor->close(cursor); @@ -293,7 +295,17 @@ main(void) for (i = 1; i < MAX_ITERATIONS; i++) { ret = add_work(session, i); ret = session->checkpoint(session, NULL); + /* + * The full backup here is only needed for testing and + * comparison purposes. A normal incremental backup + * procedure would not include this. + */ ret = take_full_backup(session, i); + /* + * Taking the incremental backup also calls truncate + * to archive the log files, if the copies were successful. + * See that function for details on that call. + */ ret = take_incr_backup(session, i); ret = compare_backups(session, i); |