From 4ff34e9d3b747097a4bc88efd8171cae832a94e9 Mon Sep 17 00:00:00 2001 From: "terry%mozilla.org" <> Date: Fri, 18 Feb 2000 05:40:54 +0000 Subject: Added an optional ability to keep a read-only shadow database, so that bug queries can be run against it, so that these slow queries won't be able to tie up the rest of the system. --- defparams.pl | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'defparams.pl') diff --git a/defparams.pl b/defparams.pl index c5cf400e0..5f8d1ccc2 100644 --- a/defparams.pl +++ b/defparams.pl @@ -83,7 +83,23 @@ sub check_numeric { return ""; } - +sub check_shadowdb { + my ($value) = (@_); + $value = trim($value); + if ($value eq "") { + return ""; + } + SendSQL("SHOW DATABASES"); + while (MoreSQLData()) { + my $n = FetchOneColumn(); + if (lc($n) eq lc($value)) { + return "The $n database already exists. If that's really the name you want to use for the backup, please CAREFULLY make the existing database go away somehow, and then try again."; + } + } + SendSQL("CREATE DATABASE $value"); + SendSQL("INSERT INTO shadowlog (command) VALUES ('SYNCUP')", 1); + return ""; +} @::param_list = (); @@ -142,6 +158,18 @@ DefParam("usequip", "b", 1); +DefParam("shadowdb", + "If non-empty, then this is the name of another database in which Bugzilla will keep a shadow read-only copy of everything. This is done so that long slow read-only operations can be used against this db, and not lock up things for everyone else. Turning on this parameter will create the given database; be careful not to use the name of an existing database with useful data in it!", + "t", + "", + \&check_shadowdb); + +DefParam("queryagainstshadowdb", + "If this is on, and the shadowdb is set, then queries will happen against the shadow database.", + "b", + 0); + + DefParam("usedespot", "If this is on, then we are using the Despot system to control our database of users. Bugzilla won't ever write into the user database, it will let the Despot code maintain that. And Bugzilla will send the user over to Despot URLs if they need to change their password. Also, in that case, Bugzilla will treat the passwords stored in the database as being crypt'd, not plaintext.", "b", -- cgit v1.2.3-24-g4f1b