Bug 6566 - catalog is always rebuilt when server config is not readonly
: catalog is always rebuilt when server config is not readonly
Status: RESOLVED FIXINSOURCE
Product: pkg
api-python
: unspecified
: ANY/Generic All
: P4 normal (vote)
: ---
Assigned To: Shawn Walker
: pkg/api-python watcher
:
:
:
:
:
  Show dependency treegraph
 
Reported: 2009-02-11 10:23 UTC by Shawn Walker
Modified: 2009-02-13 12:09 UTC (History)
1 user (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Shawn Walker 2009-02-11 10:23:50 UTC
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.
Comment 1 Shawn Walker 2009-02-11 10:31:07 UTC
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.
Comment 2 Brock Pytlik 2009-02-11 10:42:17 UTC
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.
Comment 3 Shawn Walker 2009-02-11 10:47:03 UTC
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.
Comment 4 Brock Pytlik 2009-02-11 10:56:01 UTC
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.
Comment 5 Shawn Walker 2009-02-13 12:09:06 UTC
Fixed in changeset 873 / b95d76c53b5eeece7335982e3ccf7047770decc4.