Closed Bug 700362 Opened 14 years ago Closed 13 years ago

Enable multidb routing on affiliates

Categories

(Firefox Affiliates Graveyard :: affiliates.mozilla.org, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: wenzel, Assigned: osmose)

Details

(Whiteboard: [qa-])

Turns out, playdoh shipped with our django multidb router, but did not enable it by default. The chances that it is enabled on affiliates prod are therefore pretty slim. Please enable the multidb router on stage and prod by making the necessary code and settings changes. CCing tofumatt: When you land this on funfactory/playdoh, will you link to the commits here, so mkelly knows what to fix? Thanks!
Assignee: nobody → mkelly
Check out the new setting in https://github.com/mozilla/playdoh/blob/base/settings/local.py-dist#L31 You just need to have slaves defined in your DATABASES dict, then add them to the SLAVE_DATABASES array.
Product: Websites → Firefox Affiliates
I checked on affiliates-dev, and the SLAVE_DATABASES list is set. I can only assume the same is true for staging and production. CCing jd in case I'm wrong, but I think this bug is FIXED. :D
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
I am not sure what the question is here. I can tell you that there is a slave database configuration array in the local.py file for stage and prod. However the "SLAVE_DATABASES = ['slave']" option is only set in dev so I am guessing this needs to be changed? Let me know if that is the case and I can take care of it as you like.
(In reply to Jason Crowe [:jd] from comment #3) > I am not sure what the question is here. I can tell you that there is a > slave database configuration array in the local.py file for stage and prod. > However the "SLAVE_DATABASES = ['slave']" option is only set in dev so I am > guessing this needs to be changed? Let me know if that is the case and I can > take care of it as you like. I believe so. The docs on https://github.com/jbalogh/django-multidb-router say that the slave database aliases need to be specified in the SLAVE_DATABASES setting. Do you want me to file a specific IT bug for adding this setting to stage and prod? Also, is it possible to check the logs of the slave databases to see if they're being used? I'm curious if we've had them configured all this time without using them, or if there's another configuration we don't know about that's handling this.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Yes, please file a new bug for tracking, you can assign it to me. I am somewhat sure that the SLAVE_DATABASES setting is relevant and that you are not using the slave db on stage and prod. I have removed a bunch of SLAVE_DATABASES settings recently (on request) as it seems to break south migrations (bug in south where it attempts to execute everything on the master then the slave - which fails as the job already replicated to the slave). I was told this is fixed in newer versions of south so perhaps this is not an issue for you.
Affiliates is on south 0.7.4, the latest is 0.7.6, and the release notes for versions in-between mention nothing about slave or multiple database issues, so I don't think we will run into any issues. Filed bug 852683 to track adding the setting to stage and prod. Thanks!
Resolved as per bug 852683.
Status: REOPENED → RESOLVED
Closed: 13 years ago → 13 years ago
Resolution: --- → FIXED
Bumping to verified as [qa-]
Status: RESOLVED → VERIFIED
Whiteboard: [qa-]
Product: Firefox Affiliates → Firefox Affiliates Graveyard
You need to log in before you can comment on or make changes to this bug.