Closed
Bug 1093828
Opened 11 years ago
Closed 10 years ago
Add a site-wide banner to warn users that the database is read-only
Categories
(Mozilla QA Graveyard :: MozTrap, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: mbrandt, Assigned: bsilverberg)
Details
(Whiteboard: [data:consultative])
Attachments
(2 files)
In the event the database reverts to a read-only state a site-wide banner should be displayed to warns users of the problem, the message should include who to contact.
Example scenario - recently an automated fail over in our data center occurred, the db failed over to a secondary master that defaults to read-only. From outward appearances the site appeared to be online but produced a 500 error when users tried to save test results.
Comment 1•11 years ago
|
||
Peter, might I cajole you somehow into looking into fixing this? :-) (For context, came out of a post-mortem, and was identified as being really helpful to both end-users and on-call/sys/DB-admins, alike.)
Flags: needinfo?(peterbe)
Comment 2•11 years ago
|
||
(Or, Bob, feel free to grab this and take a look, too!)
Flags: needinfo?(bob.silverberg)
Comment 3•11 years ago
|
||
I'm actually not familiar with the read-only mode. Is this a thing and all we need to do is build the banner or does it need the read-only mode functionality too?
Flags: needinfo?(peterbe)
Assignee | ||
Comment 4•11 years ago
|
||
I wouldn't know where to start with this either, but I could try if Peter doesn't have time (and has advice). Is there a way for us to know that the database has been put into read-only mode?
Flags: needinfo?(bob.silverberg)
Reporter | ||
Updated•11 years ago
|
Priority: -- → P2
Comment 5•11 years ago
|
||
Flags: needinfo?(scabral)
Flags: needinfo?(cturra)
Comment 6•11 years ago
|
||
you can query for "show variables like 'read_only' " and that will say ON or OFF - so, read_only=ON would be when the db is read only.
Flags: needinfo?(scabral)
Assignee | ||
Comment 7•11 years ago
|
||
Thanks Sheeri. I will give that a try.
Assignee: nobody → bob.silverberg
Assignee | ||
Comment 8•11 years ago
|
||
Peter, I have done most of what is required for this, but I'm not sure if it's suitable for Moztrap. I basically borrowed code from Kitsune, so the styling may need to be changed. Also, I haven't implemented the Javascript to close the dialog because I find the organization and implementation of the JS in Moztrap to be very confusing. I was hoping that you might have some familiarity with it and be able to collaborate with me on this patch to add the required JS.
Attachment #8522291 -
Flags: review?(peterbe)
Assignee | ||
Comment 9•11 years ago
|
||
Matt, I have prepared a PR for this that mostly works and have asked Peter for review and some help. I think we may need to wordsmith the message as well. Right now it just says:
"There is a temporary problem with the Moztrap database that has put it into a read-only state.
You may browse information on the site but no changes will be saved."
You mentioned including contact information. If you can provide a preferred paragraph I can change the code to display whatever you think is appropriate.
Flags: needinfo?(mbrandt)
Reporter | ||
Comment 10•11 years ago
|
||
Let's got with:
"There is a temporary problem and Moztrap has been placed into a read-only state. You may browse information on the site but changes will not be saved. Please contact us in #moztrap for more information."
Comment 11•11 years ago
|
||
Comment on attachment 8522291 [details] [review]
Link to Github pull-request: https://github.com/mozilla/moztrap/pull/77
let's use GitHub instead to review the code.
Attachment #8522291 -
Flags: review?(peterbe)
Reporter | ||
Updated•11 years ago
|
Flags: needinfo?(mbrandt)
Updated•11 years ago
|
Flags: needinfo?(cturra)
With the changes now landed on master and pushed to dev, can we work with Sheeri, Peter/Bob, to test that the read-only banner shows up?
Flags: needinfo?(scabral)
Comment 13•11 years ago
|
||
Sure, just let me know when. I live in #data if you can't find me elsewhere on IRC. I am in Eastern time today and tomorrow and in Portland next week.
Flags: needinfo?(scabral)
(In reply to Sheeri Cabral [:sheeri] from comment #13)
> Sure, just let me know when. I live in #data if you can't find me elsewhere
> on IRC. I am in Eastern time today and tomorrow and in Portland next week.
Sorry for the delay -- been a hectic few weeks :-( I or someone from my team will find you this week, and try to have this tested before we (all?) take off soon for the holidays!
Updated•11 years ago
|
Summary: Add a site wide banner to warn users that the database is read-only → Add a site-wide banner to warn users that the database is read-only
Comment 15•11 years ago
|
||
About testing - Right now, the moztrap DB is on a shared server with many other dbs (one mysql instance, many dbs). Also, "read_only" is a server-wide setting, so if we test by changing "read_only" we will affect others.
Another way would be to point moztrap's "write" handlers to the RO VIP, and see what happens. That's what I'd recommend. (Conveniently there's no coordination with the data team needed either!)
Reporter | ||
Comment 16•11 years ago
|
||
camd/peterbe -- if you can find time, can we do this -- comment 15?
Flags: needinfo?(peterbe)
Flags: needinfo?(cdawson)
Comment 17•11 years ago
|
||
(In reply to Sheeri Cabral [:sheeri] from comment #15)
> About testing - Right now, the moztrap DB is on a shared server with many
> other dbs (one mysql instance, many dbs). Also, "read_only" is a server-wide
> setting, so if we test by changing "read_only" we will affect others.
>
>
> Another way would be to point moztrap's "write" handlers to the RO VIP, and
> see what happens. That's what I'd recommend. (Conveniently there's no
> coordination with the data team needed either!)
If it's easy to do, let's do it. The dev server gets virtually no traffic.
Flags: needinfo?(peterbe)
Comment 18•11 years ago
|
||
Yep, sounds good to me. Sheeri-- would you be up for doing this sometime tomorrow or Friday, maybe? Dev is already running this code.
Flags: needinfo?(cdawson) → needinfo?(scabral)
Comment 19•11 years ago
|
||
I should clarify: please ping peter, matt or I on irc to help test it. :)
Comment 20•11 years ago
|
||
Oh, we can definitely do this whenever. But this is an app-level thing - changing the app's config file (or wherever it's stored) FROM "db-rw-virtualIP" to "db-ro-virtualIP".
I'll see if I can figure out where this is stored so I can help you test it out, but I think this is a webops task usually.
Flags: needinfo?(scabral)
Comment 21•11 years ago
|
||
(In reply to Sheeri Cabral [:sheeri] from comment #20)
> Oh, we can definitely do this whenever. But this is an app-level thing -
> changing the app's config file (or wherever it's stored) FROM
> "db-rw-virtualIP" to "db-ro-virtualIP".
>
> I'll see if I can figure out where this is stored so I can help you test it
> out, but I think this is a webops task usually.
I can change that easily, moztrap lives in the generic cluster, and the dev config is:
genericadm.private.phx1.mozilla.com:/data/genericrhel6-dev/src/moztrap-dev.allizom.org/moz-trap/moztrap/settings/local.py
Should I go ahead and make the change now ?
Comment 22•11 years ago
|
||
Just read back the comments, so I decided to go ahead and turn dev read-only by pointing it at:
- dev-zeus-ro.db.phx1.mozilla.com
Comment 23•11 years ago
|
||
https://moztrap-dev.allizom.org/results/runs/ there is a banner there....
Comment 24•11 years ago
|
||
We tested it this morning, and the banner DOES show. But, for both sheeri and I, not until we did a shift-reload of the page. We may want to change the implementation so that it adds a suffix to the name like:
``MozTrap-dev - READ ONLY`` Where the read-only is red or something. Hovering tells you why? Just a thought.
Comment 25•11 years ago
|
||
fwiw: Sheeri and I decided to leave dev as read-only so it could be iterated on faster. She says we can just ping her in IRC when we want it changed back.
Comment 26•11 years ago
|
||
Regarding the caching, it seems to be in the browser only. When I run this: https://gist.github.com/peterbe/7060754a88c8d4aa07e9 it never fails. The banner is always there.
If it got caught in Zeus that would not be so predictable.
Grr! Why is the browser caching it?!
Comment 27•11 years ago
|
||
peterbe says it should be more like wikipedia's fundraiser that shows up on top and doesn't let you close it, but still lets you do work. Specifically for the scenario that if you close it but come back 5 mins later and it doesn't show up, you don't know if things are back to normal or if it's still read-only but it remembers you X'd it out.
Comment 28•11 years ago
|
||
Hey Bob-- Would you be up for making this modification?
Flags: needinfo?(bob.silverberg)
Assignee | ||
Comment 29•11 years ago
|
||
camd: I would, but I am on vacation until the new year, if it can wait until then. Leaving the needinfo on as a reminder.
Assignee | ||
Comment 30•11 years ago
|
||
This is a PR to address not permanently dismissing the banner
Flags: needinfo?(bob.silverberg)
Updated•11 years ago
|
Whiteboard: [data:consultative]
Assignee | ||
Comment 31•10 years ago
|
||
I believe the work for this was done and deployed. Can anyone comment on that? Camd? Peterbe?
Flags: needinfo?(peterbe)
Flags: needinfo?(cdawson)
Comment 32•10 years ago
|
||
We did land this in master after all. And even though there might be some imperfections I'm sure it's a bunch better than nothing and besides it rarely happens (that mysql goes into read-only mode).
Feel free to re-open camd if you think it needs more work.
Status: NEW → RESOLVED
Closed: 10 years ago
Flags: needinfo?(peterbe)
Resolution: --- → FIXED
Comment 33•10 years ago
|
||
Agreed, yeah. This was landed. Sorry it was never resolved. Thanks peterbe!
Flags: needinfo?(cdawson)
Updated•7 years ago
|
Product: Mozilla QA → Mozilla QA Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•