Skip to content
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

Support 'expected_num_objects' parameter when creating pool for pg folder splitting #2031

Closed
wants to merge 1 commit into from
Closed

Support 'expected_num_objects' parameter when creating pool for pg folder splitting #2031

wants to merge 1 commit into from

Conversation

guangyy
Copy link
Contributor

@guangyy guangyy commented Jun 26, 2014

This patch adds a new parameter for pool creation named 'expected_num_objects', to give user a choice to specify the number of objects he/she would like to put into the pool. This information is used to pre-hash PG's namespace by creating a certain number of folders, so as to avoid run-time folder splitting which could saturate disk I/O.

Testing - test against various combinations of PG number and splittings.

Issue - as we add two new fields to coll_t struct, and given its encode/decode logic, when we bump up the version number, it could break old version software. This would request to upgrade all nodes before creating new pool.

Todo - doc the behavior.

Signed-off-by: Guang Yang (yguang@yahoo-inc.com)

…pre-create PG folders.

Signed-off-by: Guang Yang (yguang@yahoo-inc.com)
@@ -920,6 +937,7 @@ struct pg_pool_t {
bool has_write_tier() const { return write_tier >= 0; }
void clear_write_tier() { write_tier = -1; }

uint64_t expected_num_objects; ///< pre-hash pg folders based on the value of this setting
Copy link
Member

Choose a reason for hiding this comment

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

I would not tie the field to the implementation detail in the comment.

Adding a field to pg_pool_t does require changes to the encode(), decode(), dump(), and generate_test_instances() fields in the struct, though. Normally that would be wrapped up in a single commit. See the last change as an example: 931ae6b

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agree, thanks.

@guangyy guangyy closed this Jun 30, 2014
@guangyy
Copy link
Contributor Author

guangyy commented Jun 30, 2014

Create a new pull request:

  1. Add a new transaction so as not to touch the coll_t, so that currently there is no software upgrading issue brought by this patch.
  2. Spit into multiple commits to make it better organized.

Here is the new pull request - #2043

Thanks all.

@guangyy guangyy deleted the wip-pg-folder-split branch July 21, 2014 01:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants