requestMirror timing out

Bug #272353 reported by Michael Hudson-Doyle
10
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Stuart Bishop
Tags: lp-code
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Seems to be deep database stuff:

<mwhudson> lifeless: so the problem we have now and then with branches is that 'update branch set next_mirror_time = NOW where id = %d' times out
<mwhudson> lifeless: my guess is that this could be because the scanner has a transaction open adding branchrevision rows that reference this branch
<mwhudson> does that make sense?
<lifeless> mwhudson: yes, sounds likely
<mwhudson> and if the fkey wasn't on delete cascade this wouldn't happen?
<lifeless> mwhudson: yes
<mwhudson> ok
<mwhudson> very interesting :)

Revision history for this message
Stuart Bishop (stub) wrote :

Inserts into the BranchRevision table do block updates on the referenced Branch rows though.

I can't reproduce the ON DELETE behavior though. I don't think ON DELETE CASCADE makes any difference to locking behavior with PostgreSQL.

Revision history for this message
Stuart Bishop (stub) wrote :

Changing the foreign key constraint to deferred could be an easy fix so the lock is only taken when attempting to commit. This will cause the BranchRevision inserting transaction to block until the Branch updating transaction has committed instead (reversed).

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

A deferred constraint sounds entirely appropriate here. Do you want me to write a database patch? It seems kinda pointless as I'll have to get you to tell me what to type :)

Changed in launchpad-bazaar:
assignee: nobody → stub
importance: Undecided → High
milestone: none → 2.1.11
status: New → In Progress
Revision history for this message
Stuart Bishop (stub) wrote :

Yup. I'll handle it. We won't see this solution until the next production rollout - is that ok?

(Well... we could cowboy it in if it is a problem we need to address now, although it might require some bits being shutdown and possibly some timeouts).

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

If cowboying is a complex process, I think waiting until the rollout is OK.

If people start hitting this more often, we might have to think again.

Stuart Bishop (stub)
Changed in launchpad-bazaar:
milestone: 2.1.11 → 2.1.12
Stuart Bishop (stub)
Changed in launchpad-bazaar:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.