diff options
author | Sage Weil <sage@inktank.com> | 2013-09-09 22:27:23 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-09-09 22:27:23 -0700 |
commit | a786ad773cd33880075f1deb3691528d1afd03ec (patch) | |
tree | 43d7b476b13b324323d8263327c9071c2bf15ec2 | |
parent | 8c76f3a0f9cf100ea2c941dc2b61c470aa5033d7 (diff) | |
download | ceph-wip-5981.tar.gz |
ceph-disk: make initial journal files 0 byteswip-5981
The ceph-osd will resize journal files up and properly fallocate() them
so that the blocks are preallocated and (hopefully) contiguous. We
don't need to do it here too, and getting fallocate() to work from
python is a pain in the butt.
Fixes: #5981
Signed-off-by: Sage Weil <sage@inktank.com>
-rwxr-xr-x | src/ceph-disk | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ceph-disk b/src/ceph-disk index 3d09bdf7418..641bd64d60e 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -888,15 +888,12 @@ def prepare_journal_dev( def prepare_journal_file( - journal, - journal_size): + journal): if not os.path.exists(journal): - LOG.debug('Creating journal file %s with size %dM', journal, journal_size) + LOG.debug('Creating journal file %s with size 0 (ceph-osd will resize and allocate)', journal) with file(journal, 'wb') as journal_file: - journal_file.truncate(journal_size * 1048576) - - # FIXME: should we resize an existing journal file? + pass LOG.debug('Journal is file %s', journal) LOG.warning('OSD will not be hot-swappable if journal is not the same device as the osd data') @@ -921,13 +918,13 @@ def prepare_journal( if not os.path.exists(journal): if force_dev: raise Error('Journal does not exist; not a block device', journal) - return prepare_journal_file(journal, journal_size) + return prepare_journal_file(journal) jmode = os.stat(journal).st_mode if stat.S_ISREG(jmode): if force_dev: raise Error('Journal is not a block device', journal) - return prepare_journal_file(journal, journal_size) + return prepare_journal_file(journal) if stat.S_ISBLK(jmode): if force_file: |