-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove creation of unused partitions, implement recommendation #1188
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -898,14 +898,16 @@ def _bluestore_partitions(self): | |
log.warning(("WAL size is unsupported for same device of " | ||
"{}".format(self.osd.device))) | ||
else: | ||
# Create wal of wal_size on wal device | ||
self.create(self.osd.wal, [('wal', self.osd.wal_size)]) | ||
log.info(("WAL will reside on same device {} as db - " | ||
"recommend removing the WAL entry from the " | ||
"configuration for device " | ||
"{}").format(self.osd.db, self.osd.device)) | ||
else: | ||
# pylint: disable=line-too-long | ||
log.warning("No size specified for wal {}. Using default sizes.".format(self.osd.wal)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unrelated to this PR but just in case - are this line and similar handling for absent db_size relevant? It looks like respective devices wouldn't be created at all rather than "using default sizes". There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If a size is not specified, we cannot create a partition. However, ceph-disk will accept a device without the partition and create partitions itself. So, the "default sizes" are for what ceph-disk will use. |
||
|
||
if self.osd.db_size: | ||
if self.osd.wal == self.osd.device: | ||
if self.osd.db == self.osd.device: | ||
# pylint: disable=line-too-long | ||
log.warning("DB size is unsupported for same device of {}".format(self.osd.device)) | ||
else: | ||
|
@@ -914,25 +916,22 @@ def _bluestore_partitions(self): | |
else: | ||
log.warning("No size specified for db {}. Using default sizes".format(self.osd.db)) | ||
else: | ||
# This situation seems unintentional - use faster media for | ||
# the wal or db but not the other. Help newbies out by | ||
# putting wal and db on same device | ||
# Only WAL | ||
if self.osd.wal: | ||
if self.osd.wal_size: | ||
if self.osd.wal == self.osd.device: | ||
log.warning(("WAL size is unsupported for same device of " | ||
"{}".format(self.osd.device))) | ||
else: | ||
log.warning("Setting db to same device {} as wal".format(self.osd.wal)) | ||
log.info("DB will reside on device {}".format(self.osd.device)) | ||
# Create wal of wal_size on wal device | ||
# Create db on wal device | ||
self.create(self.osd.wal, [('wal', self.osd.wal_size), | ||
('db', self._halve(self.osd.wal_size))]) | ||
self.create(self.osd.wal, [('wal', self.osd.wal_size)]) | ||
else: | ||
if self.osd.wal_size: | ||
log.warning(("WAL size is unsupported for same device of " | ||
"{}".format(self.osd.device))) | ||
|
||
# Only DB | ||
if self.osd.db: | ||
if self.osd.db_size: | ||
if self.osd.db == self.osd.device: | ||
|
@@ -941,9 +940,7 @@ def _bluestore_partitions(self): | |
else: | ||
log.warning("Setting wal to same device {} as db".format(self.osd.db)) | ||
# Create db of db_size on db device | ||
# Create wal on db device | ||
self.create(self.osd.db, [('wal', self._double(self.osd.db_size)), | ||
('db', self.osd.db_size)]) | ||
self.create(self.osd.db, [('db', self.osd.db_size)]) | ||
else: | ||
if self.osd.db_size: | ||
log.warning(("DB size is unsupported for same device of " | ||
|
@@ -1173,11 +1170,17 @@ def _bluestore_args(self): | |
|
||
# WAL cornercase with sizes | ||
if self.osd.wal and self.osd.wal_size and self.osd.wal != self.osd.device: | ||
_partition = self.highest_partition(self.osd.wal, 'wal') | ||
if _partition: | ||
args += "--block.wal {}{} ".format(self.osd.wal, _partition) | ||
if self.osd.db: | ||
log.warning(("Ignoring WAL setting - " | ||
"No need for two partitions, " | ||
"WAL will use same device as DB " | ||
"{}").format(self.osd.db)) | ||
else: | ||
args += "--block.wal {} ".format(self.osd.wal) | ||
_partition = self.highest_partition(self.osd.wal, 'wal') | ||
if _partition: | ||
args += "--block.wal {}{} ".format(self.osd.wal, _partition) | ||
else: | ||
args += "--block.wal {} ".format(self.osd.wal) | ||
|
||
# DB cornercase with sizes | ||
if self.osd.db and self.osd.db_size and self.osd.db != self.osd.device: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I missed something but I don't see the difference in handling following two cases:
IMO both are getting here but there is no wal creation for case 2)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the wal would not be created in either case, but the reason is different for the admin. The first message is that ceph-disk does not support specifying a wal on the same device as the OSD. The second is that it's unnecessary.