Changeset: 360197e5efb7 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=360197e5efb7
Modified Files:
clients/Tests/MAL-signatures.stable.out
clients/Tests/MAL-signatures.stable.out.int128
clients/Tests/SQL-dump.stable.out
clients/Tests/SQL-dump.stable.out.int128
clients/Tests/exports.stable.out
monetdb5/modules/mal/wlcr.c
monetdb5/modules/mal/wlcr.h
monetdb5/modules/mal/wlcr.mal
sql/scripts/60_wlcr.sql
Branch: wlcr
Log Message:
Add differente stages for the master role
To mark temporarily suspension of log records (for COPY INTO)
and to mark end-of-life of a snapshot
diffs (truncated from 488 to 300 lines):
diff --git a/clients/Tests/MAL-signatures.stable.out
b/clients/Tests/MAL-signatures.stable.out
--- a/clients/Tests/MAL-signatures.stable.out
+++ b/clients/Tests/MAL-signatures.stable.out
@@ -8738,6 +8738,7 @@ Ready.
[ "wlcr", "logrollback", "pattern wlcr.logrollback(flag:int):void ",
"WLClogrollback;", "Activate the workload-capture-replay. Also keep the
aborted transactions is flag !=0" ]
[ "wlcr", "logthreshold", "pattern wlcr.logthreshold(limit:int):void ",
"WLClogthreshold;", "Activate the workload-capture-replay. Only queries
surpassing the threshold (in milliseconds) are kept." ]
[ "wlcr", "master", "pattern wlcr.master():void ", "WLCmaster;",
"Activate the workload-capture-replay" ]
+[ "wlcr", "master", "pattern wlcr.master(flag:int):void ",
"WLCmaster;", "Activate the workload-capture-replay in a particular
mode.\nStart/Pause/Resume/Stop = 0/1/2/3" ]
[ "wlcr", "query", "pattern wlcr.query(q:str):void ",
"WLCquery;", "Keep the queries for replay." ]
[ "wlcr", "rename_user", "pattern wlcr.rename_user(sname:str,
newnme:str, action:int):void ", "WLCgeneric;", "Catalog operation
rename_user" ]
[ "wlcr", "revoke", "pattern wlcr.revoke(sname:str, tbl:str,
grantee:str, privs:int, cname:str, grant:int, grantor:int):void ",
"WLCgeneric;", "Catalog operation revoke" ]
@@ -8745,7 +8746,6 @@ Ready.
[ "wlcr", "revoke_roles", "pattern wlcr.revoke_roles(sname:str, auth:str,
grantor:int, admin:int):void ", "WLCgeneric;", "Catalog operation
revoke_roles" ]
[ "wlcr", "rollback", "pattern wlcr.rollback():void ",
"WLCcommitCmd;", "Rollback the workload-capture-replay record" ]
[ "wlcr", "rollback", "pattern wlcr.rollback():void ",
"WLCfinish;", "Mark the end of the work unit" ]
-[ "wlcr", "stopmaster", "pattern wlcr.stopmaster():void ",
"WLCstopmaster;", "Terminate keeping a log on this branch" ]
[ "wlcr", "transaction", "pattern wlcr.transaction():void ",
"WLCgeneric;", "Start an autocommit transaction" ]
[ "wlcr", "transaction_begin", "pattern
wlcr.transaction_begin(chain:int, name:str):void ", "WLCgeneric;", "A
transaction statement (type can be commit,release,rollback or start)" ]
[ "wlcr", "transaction_commit", "pattern
wlcr.transaction_commit(chain:int, name:str):void ", "WLCgeneric;", "A
transaction statement (type can be commit,release,rollback or start)" ]
diff --git a/clients/Tests/MAL-signatures.stable.out.int128
b/clients/Tests/MAL-signatures.stable.out.int128
--- a/clients/Tests/MAL-signatures.stable.out.int128
+++ b/clients/Tests/MAL-signatures.stable.out.int128
@@ -11103,6 +11103,7 @@ Ready.
[ "wlcr", "logrollback", "pattern wlcr.logrollback(flag:int):void ",
"WLClogrollback;", "Activate the workload-capture-replay. Also keep the
aborted transactions is flag !=0" ]
[ "wlcr", "logthreshold", "pattern wlcr.logthreshold(limit:int):void ",
"WLClogthreshold;", "Activate the workload-capture-replay. Only queries
surpassing the threshold (in milliseconds) are kept." ]
[ "wlcr", "master", "pattern wlcr.master():void ", "WLCmaster;",
"Activate the workload-capture-replay" ]
+[ "wlcr", "master", "pattern wlcr.master(flag:int):void ",
"WLCmaster;", "Activate the workload-capture-replay in a particular
mode.\nStart/Pause/Resume/Stop = 0/1/2/3" ]
[ "wlcr", "query", "pattern wlcr.query(q:str):void ",
"WLCquery;", "Keep the queries for replay." ]
[ "wlcr", "rename_user", "pattern wlcr.rename_user(sname:str,
newnme:str, action:int):void ", "WLCgeneric;", "Catalog operation
rename_user" ]
[ "wlcr", "revoke", "pattern wlcr.revoke(sname:str, tbl:str,
grantee:str, privs:int, cname:str, grant:int, grantor:int):void ",
"WLCgeneric;", "Catalog operation revoke" ]
@@ -11110,7 +11111,6 @@ Ready.
[ "wlcr", "revoke_roles", "pattern wlcr.revoke_roles(sname:str, auth:str,
grantor:int, admin:int):void ", "WLCgeneric;", "Catalog operation
revoke_roles" ]
[ "wlcr", "rollback", "pattern wlcr.rollback():void ",
"WLCcommitCmd;", "Rollback the workload-capture-replay record" ]
[ "wlcr", "rollback", "pattern wlcr.rollback():void ",
"WLCfinish;", "Mark the end of the work unit" ]
-[ "wlcr", "stopmaster", "pattern wlcr.stopmaster():void ",
"WLCstopmaster;", "Terminate keeping a log on this branch" ]
[ "wlcr", "transaction", "pattern wlcr.transaction():void ",
"WLCgeneric;", "Start an autocommit transaction" ]
[ "wlcr", "transaction_begin", "pattern
wlcr.transaction_begin(chain:int, name:str):void ", "WLCgeneric;", "A
transaction statement (type can be commit,release,rollback or start)" ]
[ "wlcr", "transaction_commit", "pattern
wlcr.transaction_commit(chain:int, name:str):void ", "WLCgeneric;", "A
transaction statement (type can be commit,release,rollback or start)" ]
diff --git a/clients/Tests/SQL-dump.stable.out
b/clients/Tests/SQL-dump.stable.out
--- a/clients/Tests/SQL-dump.stable.out
+++ b/clients/Tests/SQL-dump.stable.out
@@ -355,7 +355,6 @@ Ready.
\dSf sys."stddev_pop"
\dSf sys."stddev_samp"
\dSf sys."stop"
-\dSf sys."stopmaster"
\dSf sys."storage"
\dSf sys."storagemodel"
\dSf sys."storagemodelinit"
@@ -781,7 +780,6 @@ SYSTEM FUNCTION sys.st_z
SYSTEM FUNCTION sys.stddev_pop
SYSTEM FUNCTION sys.stddev_samp
SYSTEM FUNCTION sys.stop
-SYSTEM FUNCTION sys.stopmaster
SYSTEM FUNCTION sys.storage
SYSTEM FUNCTION sys.storagemodel
SYSTEM FUNCTION sys.storagemodelinit
@@ -991,6 +989,7 @@ create procedure logthreshold(duration i
create function sys.malfunctions() returns table("module" string, "function"
string, "signature" string, "address" string, "comment" string) external name
"manual"."functions";
create function "masklen" (p inet) returns int external name inet."masklen";
create procedure master() external name wlcr.master;
+create procedure master(role integer) external name wlcr.master;
create function mbr(geom geometry) returns mbr external name geom."mbr";
create function sys.md5(v string) returns string external name clients.md5sum;
create aggregate median(val tinyint) returns tinyint external name
"aggr"."median";
@@ -1195,7 +1194,6 @@ create aggregate stddev_samp(val time) r
create aggregate stddev_samp(val timestamp) returns double external name
"aggr"."stdev";
create procedure sys.stop(tag int) external name sql.sysmon_stop;
create procedure sys.stop(tag bigint) external name sql.sysmon_stop;
-create procedure stopmaster() external name wlcr.stopmaster;
create function sys."storage"() returns table ("schema" string, "table"
string, "column" string, "type" string, "mode" string, location string, "count"
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash
boolean, "imprints" bigint, sorted boolean, revsorted boolean, "unique"
boolean, orderidx bigint) external name sql."storage";
create function sys."storage"(sname string) returns table ("schema" string,
"table" string, "column" string, "type" string, "mode" string, location string,
"count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes
bigint, phash boolean, "imprints" bigint, sorted boolean, revsorted boolean,
"unique" boolean, orderidx bigint) external name sql."storage";
create function sys."storage"(sname string, tname string) returns table
("schema" string, "table" string, "column" string, "type" string, "mode"
string, location string, "count" bigint, typewidth int, columnsize bigint,
heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted
boolean, revsorted boolean, "unique" boolean, orderidx bigint) external name
sql."storage";
@@ -2155,6 +2153,7 @@ drop function pcre_replace(string, strin
[ "sys", "malfunctions", "create function sys.malfunctions() returns
table(\"module\" string, \"function\" string, \"signature\" string, \"address\"
string, \"comment\" string) external name \"manual\".\"functions\";",
"manual", 1, 5, false, false, false ]
[ "sys", "masklen", "create function \"masklen\" (p inet) returns
int external name inet.\"masklen\";", "inet", 1, 1, false,
false, false ]
[ "sys", "master", "create procedure master() external name
wlcr.master;", "wlcr", 1, 2, true, false, false ]
+[ "sys", "master", "create procedure master(role integer) external
name wlcr.master;", "wlcr", 1, 2, true, false, false ]
[ "sys", "max", "max", "aggr", 0, 3, false, false, false
]
[ "sys", "mbr", "create function mbr(geom geometry) returns mbr
external name geom.\"mbr\";", "geom", 1, 1, false, false, false
]
[ "sys", "mbr_above", "mbrAbove", "geom", 0, 1, false,
false, false ]
@@ -3253,7 +3252,6 @@ drop function pcre_replace(string, strin
[ "sys", "stddev_samp", "create aggregate stddev_samp(val tinyint)
returns double external name \"aggr\".\"stdev\";", "aggr", 1, 3,
false, false, false ]
[ "sys", "stop", "create procedure sys.stop(tag bigint) external name
sql.sysmon_stop;", "sql", 1, 2, true, false, false ]
[ "sys", "stop", "create procedure sys.stop(tag int) external name
sql.sysmon_stop;", "sql", 1, 2, true, false, false ]
-[ "sys", "stopmaster", "create procedure stopmaster() external name
wlcr.stopmaster;", "wlcr", 1, 2, true, false, false ]
[ "sys", "storage", "create function sys.\"storage\"() returns
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string,
\"mode\" string, location string, \"count\" bigint, typewidth int, columnsize
bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint,
sorted boolean, revsorted boolean, \"unique\" boolean, orderidx bigint)
external name sql.\"storage\";", "sql", 1, 5, false, false,
false ]
[ "sys", "storage", "create function sys.\"storage\"(sname string)
returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\"
string, \"mode\" string, location string, \"count\" bigint, typewidth int,
columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\"
bigint, sorted boolean, revsorted boolean, \"unique\" boolean, orderidx bigint)
external name sql.\"storage\";", "sql", 1, 5, false, false,
false ]
[ "sys", "storage", "create function sys.\"storage\"(sname string,
tname string) returns table (\"schema\" string, \"table\" string, \"column\"
string, \"type\" string, \"mode\" string, location string, \"count\" bigint,
typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash
boolean, \"imprints\" bigint, sorted boolean, revsorted boolean, \"unique\"
boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5,
false, false, false ]
@@ -3712,6 +3710,7 @@ drop function pcre_replace(string, strin
[ "sys", "malfunctions", "function", "clob", 0, 0, 0,
"signature", "clob", 0, 0, 0, "address", "clob", 0,
0, 0, "comment", "clob", 0, 0, 0, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL ]
[ "sys", "masklen", "p", "inet", 0, 0, 1, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "master", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
+[ "sys", "master", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "max", "arg", "any", 0, 0, 1, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "mbr", "geom", "geometry", 0, 0, 1, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "mbr_above", "arg_1", "geometry", 0, 0,
1, "arg_2", "geometry", 0, 0, 1, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL ]
@@ -4810,7 +4809,6 @@ drop function pcre_replace(string, strin
[ "sys", "stddev_samp", "val", "tinyint", 8, 0, 1,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
]
[ "sys", "stop", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "stop", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
-[ "sys", "stopmaster", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "storage", "table", "clob", 0, 0, 0,
"column", "clob", 0, 0, 0, "type", "clob", 0, 0,
0, "mode", "clob", 0, 0, 0, "location", "clob", 0,
0, 0, "count", "bigint", 64, 0, 0,
"typewidth", "int", 32, 0, 0, "columnsize", "bigint",
64, 0, 0, "heapsize", "bigint", 64, 0, 0,
"hashes", "bigint", 64, 0, 0, "phash",
"boolean", 1, 0, 0, "imprints", "bigint", 64,
0, 0, "sorted", "boolean", 1, 0, 0,
"revsorted", "boolean", 1, 0, 0, "unique",
"boolean", 1, 0, 0 ]
[ "sys", "storage", "table", "clob", 0, 0, 0,
"column", "clob", 0, 0, 0, "type", "clob", 0, 0,
0, "mode", "clob", 0, 0, 0, "location", "clob", 0,
0, 0, "count", "bigint", 64, 0, 0,
"typewidth", "int", 32, 0, 0, "columnsize", "bigint",
64, 0, 0, "heapsize", "bigint", 64, 0, 0,
"hashes", "bigint", 64, 0, 0, "phash",
"boolean", 1, 0, 0, "imprints", "bigint", 64,
0, 0, "sorted", "boolean", 1, 0, 0,
"revsorted", "boolean", 1, 0, 0, "unique",
"boolean", 1, 0, 0 ]
[ "sys", "storage", "table", "clob", 0, 0, 0,
"column", "clob", 0, 0, 0, "type", "clob", 0, 0,
0, "mode", "clob", 0, 0, 0, "location", "clob", 0,
0, 0, "count", "bigint", 64, 0, 0,
"typewidth", "int", 32, 0, 0, "columnsize", "bigint",
64, 0, 0, "heapsize", "bigint", 64, 0, 0,
"hashes", "bigint", 64, 0, 0, "phash",
"boolean", 1, 0, 0, "imprints", "bigint", 64,
0, 0, "sorted", "boolean", 1, 0, 0,
"revsorted", "boolean", 1, 0, 0, "unique",
"boolean", 1, 0, 0 ]
@@ -6130,6 +6128,7 @@ drop function pcre_replace(string, strin
[ "malfunctions" ]
[ "masklen" ]
[ "master" ]
+[ "master" ]
[ "max" ]
[ "mbr" ]
[ "mbr_above" ]
@@ -7240,7 +7239,6 @@ drop function pcre_replace(string, strin
[ "stop" ]
[ "stop" ]
[ "stop" ]
-[ "stopmaster" ]
[ "storage" ]
[ "storage" ]
[ "storage" ]
diff --git a/clients/Tests/SQL-dump.stable.out.int128
b/clients/Tests/SQL-dump.stable.out.int128
--- a/clients/Tests/SQL-dump.stable.out.int128
+++ b/clients/Tests/SQL-dump.stable.out.int128
@@ -351,7 +351,6 @@ Ready.
\dSf sys."stddev_pop"
\dSf sys."stddev_samp"
\dSf sys."stop"
-\dSf sys."stopmaster"
\dSf sys."storage"
\dSf sys."storagemodel"
\dSf sys."storagemodelinit"
@@ -777,7 +776,6 @@ SYSTEM FUNCTION sys.st_z
SYSTEM FUNCTION sys.stddev_pop
SYSTEM FUNCTION sys.stddev_samp
SYSTEM FUNCTION sys.stop
-SYSTEM FUNCTION sys.stopmaster
SYSTEM FUNCTION sys.storage
SYSTEM FUNCTION sys.storagemodel
SYSTEM FUNCTION sys.storagemodelinit
@@ -991,6 +989,7 @@ create procedure logthreshold(duration i
create function sys.malfunctions() returns table("module" string, "function"
string, "signature" string, "address" string, "comment" string) external name
"manual"."functions";
create function "masklen" (p inet) returns int external name inet."masklen";
create procedure master() external name wlcr.master;
+create procedure master(role integer) external name wlcr.master;
create function mbr(geom geometry) returns mbr external name geom."mbr";
create function sys.md5(v string) returns string external name clients.md5sum;
create aggregate median(val tinyint) returns tinyint external name
"aggr"."median";
@@ -1199,7 +1198,6 @@ create aggregate stddev_samp(val timesta
create aggregate stddev_samp(val hugeint) returns double external name
"aggr"."stdev";
create procedure sys.stop(tag int) external name sql.sysmon_stop;
create procedure sys.stop(tag bigint) external name sql.sysmon_stop;
-create procedure stopmaster() external name wlcr.stopmaster;
create function sys."storage"() returns table ("schema" string, "table"
string, "column" string, "type" string, "mode" string, location string, "count"
bigint, typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash
boolean, "imprints" bigint, sorted boolean, revsorted boolean, "unique"
boolean, orderidx bigint) external name sql."storage";
create function sys."storage"(sname string) returns table ("schema" string,
"table" string, "column" string, "type" string, "mode" string, location string,
"count" bigint, typewidth int, columnsize bigint, heapsize bigint, hashes
bigint, phash boolean, "imprints" bigint, sorted boolean, revsorted boolean,
"unique" boolean, orderidx bigint) external name sql."storage";
create function sys."storage"(sname string, tname string) returns table
("schema" string, "table" string, "column" string, "type" string, "mode"
string, location string, "count" bigint, typewidth int, columnsize bigint,
heapsize bigint, hashes bigint, phash boolean, "imprints" bigint, sorted
boolean, revsorted boolean, "unique" boolean, orderidx bigint) external name
sql."storage";
@@ -2180,6 +2178,7 @@ drop function pcre_replace(string, strin
[ "sys", "malfunctions", "create function sys.malfunctions() returns
table(\"module\" string, \"function\" string, \"signature\" string, \"address\"
string, \"comment\" string) external name \"manual\".\"functions\";",
"manual", 1, 5, false, false, false ]
[ "sys", "masklen", "create function \"masklen\" (p inet) returns
int external name inet.\"masklen\";", "inet", 1, 1, false,
false, false ]
[ "sys", "master", "create procedure master() external name
wlcr.master;", "wlcr", 1, 2, true, false, false ]
+[ "sys", "master", "create procedure master(role integer) external
name wlcr.master;", "wlcr", 1, 2, true, false, false ]
[ "sys", "max", "max", "aggr", 0, 3, false, false, false
]
[ "sys", "mbr", "create function mbr(geom geometry) returns mbr
external name geom.\"mbr\";", "geom", 1, 1, false, false, false
]
[ "sys", "mbr_above", "mbrAbove", "geom", 0, 1, false,
false, false ]
@@ -3437,7 +3436,6 @@ drop function pcre_replace(string, strin
[ "sys", "stddev_samp", "create aggregate stddev_samp(val tinyint)
returns double external name \"aggr\".\"stdev\";", "aggr", 1, 3,
false, false, false ]
[ "sys", "stop", "create procedure sys.stop(tag bigint) external name
sql.sysmon_stop;", "sql", 1, 2, true, false, false ]
[ "sys", "stop", "create procedure sys.stop(tag int) external name
sql.sysmon_stop;", "sql", 1, 2, true, false, false ]
-[ "sys", "stopmaster", "create procedure stopmaster() external name
wlcr.stopmaster;", "wlcr", 1, 2, true, false, false ]
[ "sys", "storage", "create function sys.\"storage\"() returns
table (\"schema\" string, \"table\" string, \"column\" string, \"type\" string,
\"mode\" string, location string, \"count\" bigint, typewidth int, columnsize
bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\" bigint,
sorted boolean, revsorted boolean, \"unique\" boolean, orderidx bigint)
external name sql.\"storage\";", "sql", 1, 5, false, false,
false ]
[ "sys", "storage", "create function sys.\"storage\"(sname string)
returns table (\"schema\" string, \"table\" string, \"column\" string, \"type\"
string, \"mode\" string, location string, \"count\" bigint, typewidth int,
columnsize bigint, heapsize bigint, hashes bigint, phash boolean, \"imprints\"
bigint, sorted boolean, revsorted boolean, \"unique\" boolean, orderidx bigint)
external name sql.\"storage\";", "sql", 1, 5, false, false,
false ]
[ "sys", "storage", "create function sys.\"storage\"(sname string,
tname string) returns table (\"schema\" string, \"table\" string, \"column\"
string, \"type\" string, \"mode\" string, location string, \"count\" bigint,
typewidth int, columnsize bigint, heapsize bigint, hashes bigint, phash
boolean, \"imprints\" bigint, sorted boolean, revsorted boolean, \"unique\"
boolean, orderidx bigint) external name sql.\"storage\";", "sql", 1, 5,
false, false, false ]
@@ -3918,6 +3916,7 @@ drop function pcre_replace(string, strin
[ "sys", "malfunctions", "function", "clob", 0, 0, 0,
"signature", "clob", 0, 0, 0, "address", "clob", 0,
0, 0, "comment", "clob", 0, 0, 0, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL ]
[ "sys", "masklen", "p", "inet", 0, 0, 1, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "master", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
+[ "sys", "master", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "max", "arg", "any", 0, 0, 1, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "mbr", "geom", "geometry", 0, 0, 1, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "mbr_above", "arg_1", "geometry", 0, 0,
1, "arg_2", "geometry", 0, 0, 1, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL ]
@@ -5175,7 +5174,6 @@ drop function pcre_replace(string, strin
[ "sys", "stddev_samp", "val", "tinyint", 8, 0, 1,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
]
[ "sys", "stop", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "stop", NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
-[ "sys", "stopmaster", NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ]
[ "sys", "storage", "table", "clob", 0, 0, 0,
"column", "clob", 0, 0, 0, "type", "clob", 0, 0,
0, "mode", "clob", 0, 0, 0, "location", "clob", 0,
0, 0, "count", "bigint", 64, 0, 0,
"typewidth", "int", 32, 0, 0, "columnsize", "bigint",
64, 0, 0, "heapsize", "bigint", 64, 0, 0,
"hashes", "bigint", 64, 0, 0, "phash",
"boolean", 1, 0, 0, "imprints", "bigint", 64,
0, 0, "sorted", "boolean", 1, 0, 0,
"revsorted", "boolean", 1, 0, 0, "unique",
"boolean", 1, 0, 0 ]
[ "sys", "storage", "table", "clob", 0, 0, 0,
"column", "clob", 0, 0, 0, "type", "clob", 0, 0,
0, "mode", "clob", 0, 0, 0, "location", "clob", 0,
0, 0, "count", "bigint", 64, 0, 0,
"typewidth", "int", 32, 0, 0, "columnsize", "bigint",
64, 0, 0, "heapsize", "bigint", 64, 0, 0,
"hashes", "bigint", 64, 0, 0, "phash",
"boolean", 1, 0, 0, "imprints", "bigint", 64,
0, 0, "sorted", "boolean", 1, 0, 0,
"revsorted", "boolean", 1, 0, 0, "unique",
"boolean", 1, 0, 0 ]
[ "sys", "storage", "table", "clob", 0, 0, 0,
"column", "clob", 0, 0, 0, "type", "clob", 0, 0,
0, "mode", "clob", 0, 0, 0, "location", "clob", 0,
0, 0, "count", "bigint", 64, 0, 0,
"typewidth", "int", 32, 0, 0, "columnsize", "bigint",
64, 0, 0, "heapsize", "bigint", 64, 0, 0,
"hashes", "bigint", 64, 0, 0, "phash",
"boolean", 1, 0, 0, "imprints", "bigint", 64,
0, 0, "sorted", "boolean", 1, 0, 0,
"revsorted", "boolean", 1, 0, 0, "unique",
"boolean", 1, 0, 0 ]
@@ -6526,6 +6524,7 @@ drop function pcre_replace(string, strin
[ "malfunctions" ]
[ "masklen" ]
[ "master" ]
+[ "master" ]
[ "max" ]
[ "mbr" ]
[ "mbr_above" ]
@@ -7795,7 +7794,6 @@ drop function pcre_replace(string, strin
[ "stop" ]
[ "stop" ]
[ "stop" ]
-[ "stopmaster" ]
[ "storage" ]
[ "storage" ]
[ "storage" ]
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -1900,7 +1900,6 @@ str WLCmaster(Client cntxt, MalBlkPtr mb
str WLCquery(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str WLCrollback(int clientid);
str WLCrollbackCmd(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
-str WLCstopmaster(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str WLCtransaction(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
str WLCupdate(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci);
int WLCused(void);
diff --git a/monetdb5/modules/mal/wlcr.c b/monetdb5/modules/mal/wlcr.c
--- a/monetdb5/modules/mal/wlcr.c
+++ b/monetdb5/modules/mal/wlcr.c
@@ -30,6 +30,7 @@
* It contains the following key=value pairs:
* snapshot=<path to a binary snapshot>
* logs=<path to the wlcr log directory>
+ * role=<started, paused,(resume), stopped>
* firstbatch=<first batch file to be applied>
* batches=<last batch file to be applied>
* drift=<maximal delay before transactions are seen globally, in
seconds>
@@ -70,6 +71,18 @@
* are no transactions running. It is solved with a separate monitor thread.
* After closing, the replicas can see from the master configuration file that
a log is available.
*
+ * The transaction loggin can be temporarily paused using the command
+ * CALL master(2)
+ * This mode should be uses sparingly. For example if you plan to perform a
COPY INTO LOCKED mode
+ * and want to avoid an avalanche of update records.
+ *
+ * Logging is resumed using the command
+ * CALL master(3)
+ * A warning is issued when during the suspension update transactions have
been issued.
+ * The final step is to close transaction logging with the command
+ * CALL master(4).
+ * It typically is the end-of-life-time for a snapshot and its log files.
+ *
*[TODO] A more secure way to set a database into master mode is to use the
command
* monetdb master <dbname> [ <optional snapshot path>]
* which locks the database, takes a save copy, initializes the state chance.
@@ -101,6 +114,7 @@
* The wlcr files purposely have a textual format derived from the MAL
statements.
* Simplicity and ease of control has been the driving argument here.
*
+ * [TODO] stop taking log files
* [TODO] consider the roll forward of SQL session variables, i.e.
optimizer_pipe (for now assume default pipe).
* [TODO] The status of the master/replica should be accessible for inspection
* [TODO] the user might want to indicate a time-stamp, to rebuild to a
certain point
@@ -117,6 +131,9 @@ static str wlcr_snapshot= 0; // The loca
static str wlcr_logs = 0; // The location in the global file store for
the logs
static stream *wlcr_fd = 0;
static int wlcr_start = 0; // time stamp of first transaction in log file
+static int wlcr_role = 0; // The current status of the in the life cycle
+static int wlcr_tag = 0; // number of database chancing transactions
+static int wlcr_pausetag = 0; // number of database chancing transactions
when pausing
// These properties are needed by the replica to direct the roll-forward.
int wlcr_threshold = 0; // should be set to -1 for production
@@ -164,6 +181,8 @@ str WLCgetConfig(void){
wlcr_threshold = atoi(path+ 10);
if( strncmp("rollback=", path, 9) == 0)
wlcr_threshold = atoi(path+ 9);
+ if( strncmp("role=", path, 5) == 0)
+ wlcr_role = atoi(path+ 5);
}
fclose(fd);
return MAL_SUCCEED;
@@ -188,6 +207,7 @@ str WLCsetConfig(void){
fprintf(fd,"snapshot=%s\n", wlcr_snapshot);
if( wlcr_logs)
fprintf(fd,"logs=%s\n", wlcr_logs);
+ fprintf(fd,"role=%d\n", wlcr_role );
fprintf(fd,"firstbatch=%d\n", wlcr_firstbatch);
fprintf(fd,"batches=%d\n", wlcr_batches );
fprintf(fd,"drift=%d\n", wlcr_drift );
@@ -300,22 +320,6 @@ WLCexit(void)
return MAL_SUCCEED;
}
-str
-WLCstopmaster(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
-{
- (void) cntxt;
- (void) mb;
- (void) stk;
- (void) pci;
-
- if( wlcr_logs == NULL)
- throw(MAL,"wlcr.stopmaster","Replica control not active");
- wlcr_batches = - wlcr_batches;
- WLCsetConfig();
-
- return MAL_SUCCEED;
-}
-
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list