Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Support formatting bricks in a brick set differently based on brick properties #1306

Merged
merged 8 commits into from Aug 10, 2018

Conversation

phlogistonjohn
Copy link
Contributor

What does this PR achieve? Why do we need it?

Support formatting arbiter bricks differently than normal bricks (xfs options) with an eye towards making it possible to make other formatting differences in the future.

Does this PR fix issues?

Fixes #1296

Notes for the reviewer

This is a collaboration of @raghavendra-talur and me, some of these patches should probably eventually get squashed, but I have not done so yet.

@@ -521,6 +523,8 @@ func (bp *StandardBrickPlacer) Replace(
newDevices := make([]*DeviceEntry, bs.SetSize)
for i := 0; i < bs.SetSize; i++ {
if i == index {
if index == arbiter_index {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am sorry, this was extra in my patch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

np. Like I mentioned in the desc. this will need to be squshed and cleaned up a bit prior to merging.

@phlogistonjohn
Copy link
Contributor Author

TODO: Add functional test to verify the formatting differences on the brick file systems.

@raghavendra-talur
Copy link
Member

Changes look good to me as per our discussion. @obnoxxx and @Madhu-1 have a look.

@phlogistonjohn
Copy link
Contributor Author

retest this please

@phlogistonjohn
Copy link
Contributor Author

Centos-ci is failing in the same place. That's suspicious, I will investigate.

@phlogistonjohn phlogistonjohn changed the title [RFC] Support formatting bricks in a brick set differently based on brick properties Support formatting bricks in a brick set differently based on brick properties Aug 9, 2018
@phlogistonjohn
Copy link
Contributor Author

retest this please

Copy link
Contributor

@obnoxxx obnoxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, but one question about the initialization inline, and a second question is whether we need to add DB upgrade code and possibly a flag for this feature in the DB?

@@ -204,6 +204,8 @@ func tryAllocateBrickOnDevice(
logger.Debug(
"Unable to place a brick of size %v & factor %v on device %v",
brickSize, snapFactor, device.Info.Id)
} else {
brick.SubType = NormalSubType
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be an initialization to a default value. Why initialize here instead of in brick_entry.go:NewBrickEntry()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could set the sub type in NewBrickEntry but the only code that "knows" the correct subtype is the placer. Normal is not the default, Unknown sub type is the default value.

The lifecycle of the new field goes something like:

  • All old entries pulled from the db will get an "unknown" sub type
  • Placers that create a new brick entry set the correct sub type
  • The new sub type values will get stored in the db
  • The create brick code path uses the value to determine the formatting for new brick fs

This approach was designed not to need a specific upgrade function. However, adding a flag to indicate that this db can contain subtypes seems reasonable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd also like to note this is similar to the approach I took for TpName & LvName to the brick entry which does not have a db flag.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. well then!

raghavendra-talur and others added 6 commits August 10, 2018 07:20
Add support to the brick request to tell the executor that a brick
file system should be formatted in one fashion or another. Define
a normal and arbiter formatting type and use the arbiter
formatting type to create a file system that allows for more
inodes.

Pair-Programmed-With: John Mulligan <jmulligan@redhat.com>
Signed-off-by: Raghavendra Talur <rtalur@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add a new brick entry field for the brick's "sub-type", which is
a semi-opaque value that can be used to determine any special
formatting for that brick.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Placers must determine what the brick's subtype is because
it is the role of the placer to carve out the bricks from
the underlying storage and they have the knowledge needed to
make the determination of the subtype.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
When the brick subtype is arbiter specify an arbiter formatting
for the executor. If the subtype is normal use normal formatting.
If the subtype is unknown and we're creating a brick request to
be used for a new brick, panic to detect misuse of the api.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Add checks to some of the arbiter functional tests to verify
that the inode percentage was set differently on the arbiter
brick than on the other bricks.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
Signed-off-by: John Mulligan <jmulligan@redhat.com>
@phlogistonjohn
Copy link
Contributor Author

DB feature flag added.

@raghavendra-talur
Copy link
Member

@obnoxxx @phlogistonjohn
I guess we could have skipped adding a DB feature flag here as the default value of 0 has no meaning. I don't mind having it though.

Changes look good to me.

@phlogistonjohn
Copy link
Contributor Author

@obnoxxx have I sufficiently handled your requests?

@phlogistonjohn
Copy link
Contributor Author

retest this please

@raghavendra-talur raghavendra-talur merged commit de7031a into heketi:master Aug 10, 2018
@phlogistonjohn phlogistonjohn deleted the jjm-xfs-plumbing branch August 13, 2018 19:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider different xfs formatting options for arbiter brick
3 participants