-
Notifications
You must be signed in to change notification settings - Fork 29
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
Fixes #37081 - Add a setting to configure PAGE_SIZE #327
Conversation
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.
ACK pending template and tests agree ;)
07a14e2
to
e3a15c9
Compare
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.
A small note on why this is useful would be nice. Though I also wonder if Pulp itself should increase the page size where needed. https://www.django-rest-framework.org/api-guide/pagination/ describes you can also do this for specific views. It also describes a mechanism similar to what Foreman has that allows you to request bigger pages. Has any effort been taken to use that route? It would give a better out of the experience for all users, not just those who tune the installer.
e3a15c9
to
58b3cb3
Compare
Most users probably don't need to tune this. In some cases, it was helpful as a workaround for other issues, such as one issue that occurred when using Katello to provide content for provisioning OpenStack. In examples like that, the end user couldn't simply request bigger pages because they are using an install script from another project. Having a setting here allows it to be configured persistently so that they aren't blocked when these types of issues occur. |
I am curious why this is what I would call a system configuration change. The ability to change this value due to performance issues feels like it should be at the application level to prevent a service restart. |
This is exactly the kind of information that should be presented in a commit message. Then reviewers don't need to guess why it's useful. And anyone reading the source can also retrieve it with But still, even if the script today may be limited, it can be worthwhile to still start the conversation. Perhaps it can be improved in the future. And as you may have seen, you can tune individual views so Pulp can still increase the default page size for some views if that's beneficial. If the script has implemented paging correctly, they will automatically benefit from larger pages without being corrected. And if it doesn't page correctly, this change would also break it. |
It turns out that Django settings are designed to be immutable. https://docs.djangoproject.com/en/5.0/topics/settings/#altering-settings-at-runtime |
Sorry, didn't mean to close this -- wrong keyboard shortcut. |
Indeed, the OpenStack bug in this case was https://bugs.launchpad.net/tripleo/+bug/2028260 |
This provides an option for users to configure the PAGE_SIZE setting in Django REST Framework as used by Pulpcore. Pulp has a default value for PAGE_SIZE but it could be overridden in the user's settings.py file. Pulp paginates views when listing repository contents, package metadata, container tags, etc. It doesn't affect delivery of content blobs, and most deployments in normal circumstances probably don't need to tune it. This setting was helpful as a workaround for an external issue that occurred when provisioning TripleO (OpenStack on OpenStack) with container content provided by Katello. In that case, the TripleO installation scripts didn't yet support pagination.
58b3cb3
to
ca4aca3
Compare
I added the following explanation to the commit message so that interested readers can understand what this is about without chasing the rabbit through Redmine and various Bugzillas:
|
@ekohl if you have a moment, mind taking a fresh look? |
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.
Indeed, the OpenStack bug in this case was https://bugs.launchpad.net/tripleo/+bug/2028260
If it doesn't do any pagination then adding a page size is never going to work reliably. When you increase the page size to 200 and there are 201 tags, you will miss one.
Since it isn't performance and this isn't solving it I'm leaning to rejecting this PR.
@@ -52,6 +52,9 @@ WORKING_DIRECTORY = "<%= scope['pulpcore::cache_dir'] %>" | |||
REMOTE_USER_ENVIRON_NAME = '<%= scope['pulpcore::remote_user_environ_name'] %>' | |||
AUTHENTICATION_BACKENDS = ['pulpcore.app.authentication.PulpNoCreateRemoteUserBackend'] | |||
|
|||
<% unless scope['pulpcore::page_size'].nil? -%> |
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.
I prefer keeping conditions simple
<% unless scope['pulpcore::page_size'].nil? -%> | |
<% if scope['pulpcore::page_size'] -%> |
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.
Well, I made the choice to write it this way so that readers know that it's the presence/absence of the value that we care about, not whether the value is truthy/falsy.
It's certainly hacky that a workaround for the OpenStack bug is to bump up the Pulpcore page size. However, it's slow for OpenStack to fix their issue, but quick and easy for us to release this configurable option. OpenStack bug aside, I think other folks could benefit from this setting since it is a Pulp configurable. If we even take this Puppet module out of the scope of Katello, wouldn't it be helpful to have more configurable options? More configurable options would mean more usefulness for people who just want to set up Pulp via Puppet. |
Pulp doesn't document the setting (https://docs.pulpproject.org/pulpcore/configuration/settings.html) so it's unclear if they want to support this at all. Just because Django Rest Framework can do it, doesn't mean the Pulp project supports it. Increasing page sizes can have certain consequences we can't oversee. For example, certain pages may become slow and lead to time outs. |
@dralley Can you weigh in here to help us out? |
I don't consider this setting part of Pulp, it's just there because we use Django REST Framework, and all the settings get merged together. We aren't very likely to switch away from Django REST Framework soon so it's stable enough to use as a workaround if you want but I would not rely on this long-term. And if you do override it I'd do it in such a way that you'd know if it ever stops working, such as by patching Pulp's own override of this setting |
Based on this and my other concerns I'm closing this. |
No description provided.