summaryrefslogtreecommitdiffstats
path: root/defparams.pl
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-02-18 06:40:54 +0100
committerterry%mozilla.org <>2000-02-18 06:40:54 +0100
commit4ff34e9d3b747097a4bc88efd8171cae832a94e9 (patch)
tree680a7889e3432e5b5dfe2580a2de9f019fa4c0f3 /defparams.pl
parent870be34704d0679153de40192b326b076343ba7d (diff)
downloadbugzilla-4ff34e9d3b747097a4bc88efd8171cae832a94e9.tar.gz
bugzilla-4ff34e9d3b747097a4bc88efd8171cae832a94e9.tar.xz
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.
Diffstat (limited to 'defparams.pl')
-rw-r--r--defparams.pl30
1 files changed, 29 insertions, 1 deletions
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",