Bugzilla – Bug 6566
catalog is always rebuilt when server config is not readonly
Last modified: 2009-02-13 12:09:06 UTC
You need to log in before you can comment on or make changes to this bug.
By default, the server catalog is rebuilt every time if the server configuration is not set to readonly. There is no reason to do this unless the user explicitly asked for a rebuild and it causes a significant delay for local publishing for large repositories.
The case is that acquire_catalog's rebuild parmater defauilts to None, and then has this check: if rebuild == None rebuild = not readonly ...which is just plain wrong.
It may be wrong, but it continued the previous behavior. Ie, the behavior before and after that change was to rebuild the catalog by default, which is probably why it's written that way. So, if rebuilding the catalog every time it's acquired is no longer needed, wonderful, but let's be sure that there isn't a reason to rebuild the catalog when it's acquired.
The only time acquire_catalog() is called is by the depot server indirectly. As it does not rebuild when readonly is true, and the depot server works just fine, it stands to reason (assuming all the test suite passes) that there is no reason to default to rebuilding the catalog always if readonly is not true.
I'm not sure I agree with that logic since there are plenty of scenarios that the test suite doesn't cover, such as an administrator killing a depot, manually removing some packages and files, and then restarting it. My guess, and it's only a guess, is that that's the reason for rebuilding by default. That said, you know far more about the depot than I do. I just wanted to raise the issue that we're changing the default behavior which dates back before the lines you pointed out were added to the code. So, if it was a design decision to make it rebuild by default, I thought we should at least discuss why that's no longer necessary. In the absence of someone explaining why the initial design decision was made, I'm fine with the change.
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.