diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2014-02-27 11:40:51 +1100 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2014-02-27 11:40:51 +1100 |
commit | 4d7b84c895f3ecca12300921f6b5018e6e326d2a (patch) | |
tree | 34c342e7b81d5623511a8f68356af7dd4b715fd3 | |
parent | 0db5283c26728d4ed8b8b0a2710aaf0022fdc441 (diff) | |
download | mongo-4d7b84c895f3ecca12300921f6b5018e6e326d2a.tar.gz |
Do buffer alignment checks when reading from checkpoints.
Update test_checkpoint01 to use valid buffer sizes.
-rw-r--r-- | src/schema/schema_create.c | 3 | ||||
-rw-r--r-- | test/suite/test_checkpoint01.py | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/src/schema/schema_create.c b/src/schema/schema_create.c index 8d620198c09..8bd78ce0ac4 100644 --- a/src/schema/schema_create.c +++ b/src/schema/schema_create.c @@ -33,7 +33,8 @@ __wt_direct_io_size_check(WT_SESSION_IMPL *session, * if you configure direct I/O and then don't do I/O in alignments and * units of its happy place. */ - if (FLD_ISSET(conn->direct_io, WT_FILE_TYPE_DATA)) { + if (FLD_ISSET(conn->direct_io, + WT_FILE_TYPE_CHECKPOINT | WT_FILE_TYPE_DATA)) { align = (int64_t)conn->buffer_alignment; if (align != 0 && (cval.val < align || cval.val % align != 0)) WT_RET_MSG(session, EINVAL, diff --git a/test/suite/test_checkpoint01.py b/test/suite/test_checkpoint01.py index 153ea015cf5..2eadc10b684 100644 --- a/test/suite/test_checkpoint01.py +++ b/test/suite/test_checkpoint01.py @@ -52,6 +52,13 @@ class test_checkpoint(wttest.WiredTigerTestCase): "checkpoint-9": ((400, 920), 0) } + # Set buffer alignment so we can use small pages. + def setUpConnectionOpen(self, dir): + wtopen_args = 'create,buffer_alignment=512' + conn = wiredtiger.wiredtiger_open(dir, wtopen_args) + self.pr(`conn`) + return conn + # Add a set of records for a checkpoint. def add_records(self, name): cursor = self.session.open_cursor(self.uri, None, "overwrite") |