/* * check_copy -- * Confirm the hot backup worked. */ static void check_copy(void) { WT_CONNECTION *conn; WT_SESSION *session; int ret; wts_open(RUNDIR_BACKUP, 0, &conn); /* * Open a session and verify the store; some data-sources don't support * verify. * * XXX * LSM can deadlock if WT_SESSION methods are called at the wrong time, * don't do that for now. */ if (!DATASOURCE("lsm") && !DATASOURCE("memrata")) { if ((ret = conn->open_session( conn, NULL, NULL, &session)) != 0) die(ret, "connection.open_session"); if ((ret = session->verify(session, g.uri, NULL)) != 0) die(ret, "session.verify: %s", g.uri); } if ((ret = conn->close(conn, NULL)) != 0) die(ret, "connection.close: %s", RUNDIR_BACKUP); }
void verify(const char *name) { WT_SESSION *session; testutil_check(conn->open_session(conn, NULL, NULL, &session)); testutil_check(session->verify(session, name, NULL)); testutil_check(session->close(session, NULL)); }
void verify(SHARED_CONFIG *cfg, const char *name) { WT_CONNECTION *conn; WT_SESSION *session; conn = cfg->conn; testutil_check(conn->open_session(conn, NULL, NULL, &session)); testutil_check(session->verify(session, name, NULL)); testutil_check(session->close(session, NULL)); }
void verify(const char *name) { WT_SESSION *session; int ret; if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) testutil_die(ret, "conn.session"); if ((ret = session->verify(session, name, NULL)) != 0) testutil_die(ret, "session.create"); if ((ret = session->close(session, NULL)) != 0) testutil_die(ret, "session.close"); }
/* * process -- * Salvage, verify and dump the created file. */ void process(void) { FILE *fp; WT_CONNECTION *conn; WT_CURSOR *cursor; const char *key, *value; WT_SESSION *session; char config[100]; /* Salvage. */ config[0] = '\0'; if (verbose) snprintf(config, sizeof(config), "error_prefix=\"%s\",verbose=[salvage,verify],", progname); strcat(config, "log=(enabled=false),"); CHECK(wiredtiger_open(NULL, NULL, config, &conn) == 0); CHECK(conn->open_session(conn, NULL, NULL, &session) == 0); CHECK(session->salvage(session, "file:" SLVG, 0) == 0); CHECK(conn->close(conn, 0) == 0); /* Verify. */ CHECK(wiredtiger_open(NULL, NULL, config, &conn) == 0); CHECK(conn->open_session(conn, NULL, NULL, &session) == 0); CHECK(session->verify(session, "file:" SLVG, 0) == 0); CHECK(conn->close(conn, 0) == 0); /* Dump. */ CHECK((fp = fopen(DUMP, "w")) != NULL); CHECK(wiredtiger_open(NULL, NULL, config, &conn) == 0); CHECK(conn->open_session(conn, NULL, NULL, &session) == 0); CHECK(session->open_cursor( session, "file:" SLVG, NULL, "dump=print", &cursor) == 0); while (cursor->next(cursor) == 0) { if (page_type == WT_PAGE_ROW_LEAF) { CHECK(cursor->get_key(cursor, &key) == 0); CHECK(fputs(key, fp) >= 0); CHECK(fputc('\n', fp) >= 0); } CHECK(cursor->get_value(cursor, &value) == 0); CHECK(fputs(value, fp) >= 0); CHECK(fputc('\n', fp) >= 0); } CHECK(conn->close(conn, 0) == 0); CHECK(fclose(fp) == 0); }
void obj_verify(void) { WT_SESSION *session; int ret; if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) die("conn.session", ret); if ((ret = session->verify(session, uri, NULL)) != 0) if (ret != ENOENT) die("session.verify", ret); if ((ret = session->close(session, NULL)) != 0) die("session.close", ret); }
void obj_verify(void) { WT_SESSION *session; int ret; if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) testutil_die(ret, "conn.session"); if ((ret = session->verify(session, uri, NULL)) != 0) if (ret != ENOENT && ret != EBUSY) testutil_die(ret, "session.verify"); if ((ret = session->close(session, NULL)) != 0) testutil_die(ret, "session.close"); }
void wts_verify(const char *tag) { WT_CONNECTION *conn; WT_SESSION *session; int ret; conn = g.wts_conn; track("verify", 0ULL, NULL); if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) die(ret, "connection.open_session"); if ((ret = session->verify(session, WT_TABLENAME, NULL)) != 0) die(ret, "session.verify: %s: %s", WT_TABLENAME, tag); if ((ret = session->close(session, NULL)) != 0) die(ret, "session.close"); }
/* * check_copy -- * Confirm the backup worked. */ static void check_copy(void) { WT_CONNECTION *conn; WT_SESSION *session; wts_open(g.home_backup, 0, &conn); testutil_checkfmt( conn->open_session(conn, NULL, NULL, &session), "%s", g.home_backup); testutil_checkfmt( session->verify(session, g.uri, NULL), "%s: %s", g.home_backup, g.uri); testutil_checkfmt(conn->close(conn, NULL), "%s", g.home_backup); }
/* * wt_shutdown -- * Flush the file to disk and shut down the WiredTiger connection. */ static void wt_shutdown(void) { WT_SESSION *session; int ret; if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) die("conn.session", ret); if ((ret = session->verify(session, FNAME, NULL)) != 0) die("session.verify", ret); if ((ret = session->sync(session, FNAME, NULL)) != 0) die("session.sync", ret); if ((ret = conn->close(conn, NULL)) != 0) die("conn.close", ret); }
/* * check_copy -- * Confirm the backup worked. */ static void check_copy(void) { WT_CONNECTION *conn; WT_SESSION *session; int ret; wts_open(g.home_backup, 0, &conn); if ((ret = conn->open_session( conn, NULL, NULL, &session)) != 0) die(ret, "connection.open_session: %s", g.home_backup); ret = session->verify(session, g.uri, NULL); if (ret != 0) die(ret, "session.verify: %s: %s", g.home_backup, g.uri); if ((ret = conn->close(conn, NULL)) != 0) die(ret, "connection.close: %s", g.home_backup); }
static void * vthread(void *arg) { WT_CURSOR *cursor_list[10]; WT_DECL_RET; WT_RAND_STATE rnd; WT_SESSION *session; u_int i, next; (void)arg; memset(cursor_list, 0, sizeof(cursor_list)); testutil_check(conn->open_session(conn, NULL, NULL, &session)); __wt_random_init_seed((WT_SESSION_IMPL *)session, &rnd); for (next = 0; !done;) { if (++next == WT_ELEMENTS(cursor_list)) next = 0; op(session, &rnd, &cursor_list[next]); while (!done) { i = __wt_random(&rnd) % uris; ret = session->verify(session, uri_list[i], NULL); if (ret == EBUSY) { (void)__wt_atomic_add64(&verify_busy, 1); continue; } testutil_check(ret); (void)__wt_atomic_add64(&verify, 1); break; } } return (NULL); }
void wts_verify(const char *tag) { WT_CONNECTION *conn; WT_SESSION *session; int ret; conn = g.wts_conn; track("verify", 0ULL, NULL); if ((ret = conn->open_session(conn, NULL, NULL, &session)) != 0) die(ret, "connection.open_session"); if (g.logging != 0) (void)session->msg_printf(session, "=============== verify start ==============="); if ((ret = session->verify(session, g.uri, NULL)) != 0) die(ret, "session.verify: %s: %s", g.uri, tag); if (g.logging != 0) (void)session->msg_printf(session, "=============== verify stop ==============="); if ((ret = session->close(session, NULL)) != 0) die(ret, "session.close"); }