summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Gorrod <alexg@wiredtiger.com>2014-02-27 12:01:11 +1100
committerAlex Gorrod <alexg@wiredtiger.com>2014-02-27 12:01:11 +1100
commitfd1080ce3d87442220305b2c3b4f9ecba35fdeb5 (patch)
tree8db2e5d8cb3bc219ace7fe9870074fdd26f2de37
parent4d7b84c895f3ecca12300921f6b5018e6e326d2a (diff)
downloadmongo-fd1080ce3d87442220305b2c3b4f9ecba35fdeb5.tar.gz
Update test/salvage to configure the right buffer size for direct io.
-rw-r--r--test/salvage/salvage.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/salvage/salvage.c b/test/salvage/salvage.c
index eda47d08283..fcde7b335de 100644
--- a/test/salvage/salvage.c
+++ b/test/salvage/salvage.c
@@ -461,8 +461,10 @@ build(int ikey, int ivalue, int cnt)
* Disable logging: we're modifying files directly, we don't want to
* run recovery.
*/
+ (void)snprintf(config, sizeof(config),
+ "create,log=(enabled=false),buffer_alignment=%d", PSIZE);
assert(wiredtiger_open(
- NULL, NULL, "create,log=(enabled=false)", &conn) == 0);
+ NULL, NULL, config, &conn) == 0);
assert(conn->open_session(conn, NULL, NULL, &session) == 0);
assert(session->drop(session, "file:" LOAD, "force") == 0);
@@ -603,15 +605,18 @@ process(void)
WT_CURSOR *cursor;
const char *key, *value;
WT_SESSION *session;
- char config[100];
+ char config[256];
+ uint32_t config_offset;
/* Salvage. */
+ config_offset = 0;
config[0] = '\0';
if (verbose)
- snprintf(config, sizeof(config),
+ config_offset += (uint32_t)snprintf(config, sizeof(config),
"error_prefix=\"%s\",verbose=[salvage,verify],",
progname);
- strcat(config, "log=(enabled=false),");
+ snprintf(config + config_offset, sizeof(config) - config_offset,
+ "log=(enabled=false),buffer_alignment=%d", PSIZE);
assert(wiredtiger_open(NULL, NULL, config, &conn) == 0);
assert(conn->open_session(conn, NULL, NULL, &session) == 0);