Open rnavarropiris opened 7 years ago
case 2 was reproduced on an Ubuntu 14.04 server (without docker). Setup:
export VIRTUOSO_VERSION="v7.2.4.2"
export CFLAGS="-O2 -m64"
apt-get update && \
apt-get -y install dpkg-dev build-essential git && \
apt-get -y install autoconf automake libtool flex bison gperf && \
apt-get -y install gawk m4 make openssl libssl-dev libreadline-dev && \
apt-get clean && \
# Install virtuoso
git clone --recursive https://github.com/openlink/virtuoso-opensource.git /opt/virtuoso-opensource.src && \
cd /opt/virtuoso-opensource.src && \
git checkout ${VIRTUOSO_VERSION} && \
./autogen.sh && \
CFLAGS="-O2 -m64" && \
export CFLAGS && \
./configure --prefix=/opt/virtuoso-opensource --with-readline && \
make -j 8 && \
make install && \
ln -s /opt/virtuoso-opensource/bin/isql /usr/bin/isql && \
rm -rf /opt/virtuoso-opensource.src && \
mkdir -p /data
chown vagrant:vagrant data
cp /vagrant/virtuoso.ini /data/virtuoso.ini
**Steps 1-4:
vagrant@vagrant-ubuntu-trusty-64:/data$ ./test.sh
Starting server...
Wed Nov 23 2016
11:00:14 OpenLink Virtuoso Universal Server
11:00:14 Version 07.20.3217-pthreads for Linux as of Nov 23 2016
11:00:14 uses parts of OpenSSL, PCRE, Html Tidy
11:00:14 SQL Optimizer enabled (max 1000 layouts)
11:00:14 Compiler unit is timed at 0.000376 msec
11:00:16 Checkpoint started
11:00:16 Roll forward started
11:00:16 Roll forward complete
11:00:16 Checkpoint started
11:00:16 Checkpoint finished, log reused
11:00:16 Checkpoint started
11:00:16 Checkpoint finished, log reused
11:00:17 Checkpoint started
11:00:17 Checkpoint finished, log reused
11:00:17 Checkpoint started
11:00:17 Checkpoint finished, log reused
11:00:17 Checkpoint started
11:00:17 Checkpoint finished, log reused
11:00:17 PL LOG: Installing Virtuoso Conductor version 1.00.8759 (DAV)
11:00:17 PL LOG: Installing with dependencies Virtuoso Conductor version 1.00.8759/2016-11-23 08:10 (DAV)
11:00:17 Checkpoint started
11:00:17 Checkpoint finished, log reused
11:00:19 Checkpoint started
11:00:19 Checkpoint finished, log reused
11:00:19 PL LOG: Installation with dependencies complete
11:00:19 Default charset UTF-8 not defined. Reverting to ISO-8859-1
11:00:19 Checkpoint started
11:00:19 Checkpoint finished, log reused
11:00:19 SSL server online at 2111
11:00:19 HTTP/WebDAV server online at 8890
11:00:19 Server online at 1111 (pid 5602)
Startup successful
Preparing trigger...
11:00:24 EXEC_1 0 127.0.0.1 1111:2 s1111_2_0 Exec 1 time(s) CREATE TRIGGER before_insert BEFORE INSERT ON DB.DBA.RDF_QUAD REFERENCING NEW AS QUAD { declare quadInstances integer; select count (*) into quadInstances from DB.DBA.RDF_QUAD WHERE __i2id ('urn:g') = G; dbg_printf('before insert count of <urn:g> : %d', quadInstances); }
Running inserts...
11:00:24 EXEC_1 0 127.0.0.1 1111:3 s1111_3_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:24 EXEC_1 0 127.0.0.1 1111:4 s1111_4_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o0>}}
before insert count of <urn:g> : 0
11:00:24 EXEC_1 0 127.0.0.1 1111:5 s1111_5_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:24 EXEC_1 0 127.0.0.1 1111:6 s1111_6_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o1>}}
before insert count of <urn:g> : 0
11:00:24 EXEC_1 0 127.0.0.1 1111:7 s1111_7_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:24 EXEC_1 0 127.0.0.1 1111:8 s1111_8_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o2>}}
before insert count of <urn:g> : 0
11:00:24 EXEC_1 0 127.0.0.1 1111:9 s1111_9_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:24 EXEC_1 0 127.0.0.1 1111:10 s1111_10_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o3>}}
before insert count of <urn:g> : 0
11:00:25 EXEC_1 0 127.0.0.1 1111:11 s1111_11_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:25 EXEC_1 0 127.0.0.1 1111:12 s1111_12_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o4>}}
before insert count of <urn:g> : 0
11:00:25 EXEC_1 0 127.0.0.1 1111:13 s1111_13_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:25 EXEC_1 0 127.0.0.1 1111:14 s1111_14_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o5>}}
before insert count of <urn:g> : 0
11:00:25 EXEC_1 0 127.0.0.1 1111:15 s1111_15_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:25 EXEC_1 0 127.0.0.1 1111:16 s1111_16_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o6>}}
before insert count of <urn:g> : 0
11:00:25 EXEC_1 0 127.0.0.1 1111:17 s1111_17_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:25 EXEC_1 0 127.0.0.1 1111:18 s1111_18_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o7>}}
before insert count of <urn:g> : 0
11:00:25 EXEC_1 0 127.0.0.1 1111:19 s1111_19_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:25 EXEC_1 0 127.0.0.1 1111:20 s1111_20_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o8>}}
before insert count of <urn:g> : 0
11:00:25 EXEC_1 0 127.0.0.1 1111:21 s1111_21_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:25 EXEC_1 0 127.0.0.1 1111:22 s1111_22_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o9>}}
before insert count of <urn:g> : 0
Inserts finished
Shuting server down...
11:00:25 EXEC_1 0 127.0.0.1 1111:23 s1111_23_0 Exec 1 time(s) SHUTDOWN
11:00:25 Checkpoint started
11:00:25 Checkpoint finished, log reused
11:00:25 Server shutdown complete
Shutdown successful
**Steps 4-6
Starting server...
Wed Nov 23 2016
11:00:30 OpenLink Virtuoso Universal Server
11:00:30 Version 07.20.3217-pthreads for Linux as of Nov 23 2016
11:00:30 uses parts of OpenSSL, PCRE, Html Tidy
11:00:30 Database version 3126
11:00:30 SQL Optimizer enabled (max 1000 layouts)
11:00:31 Compiler unit is timed at 0.000143 msec
11:00:32 Roll forward started
11:00:32 Roll forward complete
before insert count of <urn:g> : 1
before insert count of <urn:g> : 1
before insert count of <urn:g> : 1
11:00:32 Default charset UTF-8 not defined. Reverting to ISO-8859-1
11:00:32 Checkpoint started
11:00:32 Checkpoint finished, log reused
11:00:32 SSL server online at 2111
11:00:32 HTTP/WebDAV server online at 8890
11:00:32 Server online at 1111 (pid 5865)
Startup successful
cleanup successful
Preparing trigger...
11:00:40 EXEC_1 0 127.0.0.1 1111:3 s1111_3_0 Exec 1 time(s) CREATE TRIGGER before_insert BEFORE INSERT ON DB.DBA.RDF_QUAD REFERENCING NEW AS QUAD { declare quadInstances integer; select count (*) into quadInstances from DB.DBA.RDF_QUAD WHERE __i2id ('urn:g') = G; dbg_printf('before insert count of <urn:g> : %d', quadInstances); }
Running inserts...
11:00:40 EXEC_1 0 127.0.0.1 1111:4 s1111_4_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:40 EXEC_1 0 127.0.0.1 1111:5 s1111_5_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o0>}}
before insert count of <urn:g> : 1
11:00:40 EXEC_1 0 127.0.0.1 1111:6 s1111_6_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:40 EXEC_1 0 127.0.0.1 1111:7 s1111_7_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o1>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:8 s1111_8_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:9 s1111_9_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o2>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:10 s1111_10_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:11 s1111_11_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o3>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:12 s1111_12_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:13 s1111_13_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o4>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:14 s1111_14_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:15 s1111_15_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o5>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:16 s1111_16_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:17 s1111_17_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o6>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:18 s1111_18_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:19 s1111_19_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o7>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:20 s1111_20_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:21 s1111_21_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o8>}}
before insert count of <urn:g> : 1
11:00:41 EXEC_1 0 127.0.0.1 1111:22 s1111_22_0 Exec 1 time(s) SPARQL WITH <urn:g> DELETE {?s ?p ?o} WHERE {?s ?p ?o}
11:00:41 EXEC_1 0 127.0.0.1 1111:23 s1111_23_0 Exec 1 time(s) SPARQL INSERT DATA { GRAPH <urn:g> {<urn:s> <urn:p> <urn:o9>}}
before insert count of <urn:g> : 1
Inserts finished
Shuting server down...
11:00:41 EXEC_1 0 127.0.0.1 1111:24 s1111_24_0 Exec 1 time(s) SHUTDOWN
11:00:41 Checkpoint started
11:00:41 Checkpoint finished, log reused
11:00:41 Server shutdown complete
Shutdown successful
Rene logged a support case for this issue where it is being looked into ...
Problem description
Triggers declared as BEFORE INSERT show an inconsistent behaviour on different setups. In most cases, it seems as if the trigger does not respect the BEFORE behaviour.
Might be related to this issue: https://github.com/openlink/virtuoso-opensource/issues/262
Process
The provided script (
test.sh
, see below):virtuoso.ini
file (see below)BEFORE INSERT ON RDF_QUAD
trigger which logs the number of triples in the graph (expected to be 0 at all times)It is expected that the logfile of both runs shows the same counts, which should always be 0.
The following test cases were executed several times, leading always to the same result documented here.
Case 1: MacOs version
System:
Installed with
brew
(brew install virtuoso
):Both logfiles are wrong, as the count shows 1 instead of the expected 0
Logfile (steps 1-4):
Logfile (steps 5-6):
Case 2: docker container
Setup (in an image based on the Ubuntu 14.04 image):
The first logfile is ok, the second is not, as the count shows 1 instead of the expected 0
Logfile (steps 1-4):
Logfile (steps 5-6):
Case 3: docker container (with volume mounting)
Same setup as in case 2, but the directory were the database files are created is a mounted directory.
Logfile (steps 1-4):
Logfile (steps 5-6):
test.sh
virtuoso.ini