10000 Merge branch 'main' into dependabot/maven/org.postgresql-postgresql-4… · cmu-db/benchbase@afb12a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit afb12a1

Browse filesBrowse files
authored
Merge branch 'main' into dependabot/maven/org.postgresql-postgresql-42.7.5
2 parents 68c9095 + 4ac0750 commit afb12a1

File tree

24 files changed

+343
-18
lines changed

24 files changed

+343
-18
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,15 @@
2525
"--env-file=.env"
2626
],
2727
"features": {
28-
"ghcr.io/devcontainers/features/docker-outside-of-docker": {},
29-
"ghcr.io/stuartleeks/dev-container-features/shell-history": {}
28+
"ghcr.io/devcontainers/features/docker-outside-of-docker": {
29+
"moby": true,
30+
"installDockerBuildx": true,
31+
"installDockerComposeSwitch": true,
32+
"version": "latest",
33+
"dockerDashComposeVersion": "v2"
34+
},
35+
"ghcr.io/stuartleeks/dev-container-features/shell-history": {},
36+
"ghcr.io/devcontainers/features/git": {}
3037
},
3138
"containerEnv": {
3239
"http_proxy": "${localEnv:http_proxy}",

.github/workflows/maven.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,13 @@ jobs:
689689
entrypoint: /opt/mssql-tools/bin/sqlcmd
690690
args: -U sa -P SApassword1 -S sqlserver -b -Q "USE benchbase; CREATE USER benchuser01 FROM LOGIN benchuser01; EXEC sp_addrolemember 'db_owner', 'benchuser01';"
691691

692+
- name: Setup privileged access for monitoring and session start tests
693+
uses: docker://mcr.microsoft.com/mssql-tools:latest
694+
with:
695+
entrypoint: /opt/mssql-tools/bin/sqlcmd
696+
args: -U sa -P SApassword1 -S sqlserver -b -Q "USE master; GRANT ALTER SERVER STATE, VIEW SERVER PERFORMANCE STATE to benchuser01;"
697+
698+
692699
- name: Run benchmark
693700
# Note: user/pass should match those used in sample configs.
694701
run: |

config/sqlserver/sample_noop_config.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
<isolation>TRANSACTION_SERIALIZABLE</isolation>
1212
<batchsize>128</batchsize>
1313

14+
<!-- Session setup statements file -->
15+
<!-- uncommented here for CI pipeline testing -->
16+
<sessionsetupfile>config/sqlserver/session_setup_sqlserver_cmds_example.sql</sessionsetupfile>
17+
1418
<!-- This parameter has no affect on this benchmark-->
1519
<!-- There is no data to load -->
1620
<scalefactor>1</scalefactor>

config/sqlserver/sample_tpch_config.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
<reconnectOnConnectionFailure>true</reconnectOnConnectionFailure>
1111
<isolation>TRANSACTION_SERIALIZABLE</isolation>
1212
<batchsize>1024</batchsize>
13+
<!-- Session setup statements file -->
14+
<!-- <sessionsetupfile>config/sqlserver/session_setup_sqlserver_cmds_example.sql</sessionsetupfile> -->
1315

1416
<scalefactor>0.1</scalefactor>
1517

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- SQL Server Database Console Command statements (DBCC)
2+
-- NOTE: Requires "ALTER SERVER STATE" permission
3+
DBCC DROPCLEANBUFFERS -- clear buffers (for cold runs)
4+
DBCC FREEPROCCACHE -- clean plan cache

docker/benchbase/devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ ARG CONTAINERUSER_GID=1000
1717
RUN groupadd --non-unique --gid ${CONTAINERUSER_GID} containergroup \
1818
&& useradd --non-unique --create-home --no-user-group --comment 'Container User' \
1919
--uid ${CONTAINERUSER_UID} --gid ${CONTAINERUSER_GID} containeruser \
20+
&& echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers \
2021
&& echo 'containeruser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
2122
RUN mkdir -p /benchbase/results && chown -R containeruser:containergroup /benchbase/
2223
USER containeruser

docker/sqlserver-latest/up.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ run_sqlcmd_in_docker -Q "CREATE LOGIN benchuser01 WITH PASSWORD='P@ssw0rd';" ||
3838

3939
# Setup access
4040
run_sqlcmd_in_docker -Q "USE benchbase; CREATE USER benchuser01 FROM LOGIN benchuser01; EXEC sp_addrolemember 'db_owner', 'benchuser01';" || true
41+
42+
# Setup privileged access for monitoring and session start tests
43+
run_sqlcmd_in_docker -Q "USE master; GRANT ALTER SERVER STATE, VIEW SERVER PERFORMANCE STATE TO benchuser01;" || true

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
<dependency>
126126
<groupId>com.oracle.database.jdbc</groupId>
127127
<artifactId>ojdbc11</artifactId>
128-
<version>23.6.0.24.10</version>
128+
<version>23.7.0.25.01</version>
129129
<scope>runtime</scope>
130130
</dependency>
131131
</dependencies>
@@ -319,7 +319,7 @@
319319
<dependency>
320320
<groupId>org.hsqldb</groupId>
321321
<artifactId>hsqldb</artifactId>
322-
<version>2.7.3</version>
322+
<version>2.7.4</version>
323323
<scope>test</scope>
324324
</dependency>
325325

sr F438 c/main/java/com/oltpbenchmark/DBWorkload.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ public static void main(String[] args) throws Exception {
138138
wrkld.setPassword(xmlConfig.getString("password"));
139139
wrkld.setRandomSeed(xmlConfig.getInt("randomSeed", -1));
140140
wrkld.setBatchSize(xmlConfig.getInt("batchsize", 128));
141+
wrkld.setSessionSetupFile(xmlConfig.getString("sessionsetupfile"));
141142
wrkld.setMaxRetries(xmlConfig.getInt("retries", 3));
142143
wrkld.setNewConnectionPerTxn(xmlConfig.getBoolean("newConnectionPerTxn", false));
143144
wrkld.setReconnectOnConnectionFailure(
@@ -196,6 +197,9 @@ public static void main(String[] args) throws Exception {
196197
initDebug.put("URL", wrkld.getUrl());
197198
initDebug.put("Isolation", wrkld.getIsolationString());
198199
initDebug.put("Batch Size", wrkld.getBatchSize());
200+
initDebug.put("DDL Path", wrkld.getDDLPath());
201+
initDebug.put("Loader Threads", wrkld.getLoaderThreads());
202+
initDebug.put("Session Setup File", wrkld.getSessionSetupFile());
199203
initDebug.put("Scale Factor", wrkld.getScaleFactor());
200204
initDebug.put("Terminals", wrkld.getTerminals());
201205
initDebug.put("New Connection Per Txn", wrkld.getNewConnectionPerTxn());
@@ -247,6 +251,7 @@ public static void main(String[] args) throws Exception {
247251
if (xmlConfig.containsKey("afterload")) {
248252
bench.setAfterLoadScriptPath(xmlConfig.getString("afterload"));
249253
}
254+
initDebug.put("After Load Script", bench.getAfterLoadScriptPath());
250255

251256
TransactionType tmpType =
252257
bench.initTransactionType(

src/main/java/com/oltpbenchmark/WorkloadConfiguration.java

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717

1818
import com.oltpbenchmark.api.TransactionTypes;
1919
import com.oltpbenchmark.types.DatabaseType;
20+
import com.oltpbenchmark.util.FileUtil;
2021
import com.oltpbenchmark.util.ThreadUtil;
22+
import java.io.FileNotFoundException;
2123
import java.sql.Connection;
2224
import java.util.ArrayList;
2325
import java.util.List;
@@ -33,6 +35,7 @@ public class WorkloadConfiguration {
3335
private String password;
3436
private String driverClass;
3537
private int batchSize;
38+
private String sessionSetupFile;
3639
private int maxRetries;
3740
private int randomSeed = -1;
3841
private double scaleFactor = 1.0;
@@ -120,6 +123,14 @@ public void setBatchSize(int batchSize) {
120123
this.batchSize = batchSize;
121124
}
122125

126+
public String getSessionSetupFile() {
127+
return sessionSetupFile;
128+
}
129+
130+
public void setSessionSetupFile(String sessionSetupFile) throws FileNotFoundException {
131+
this.sessionSetupFile = FileUtil.checkPath(sessionSetupFile, "sessionsetupfile");
132+
}
133+
123134
public int getMaxRetries() {
124135
return maxRetries;
125136
}
@@ -292,8 +303,8 @@ public String getDDLPath() {
292303
}
293304

294305
/** Set the path in which we can find the ddl script. */
295-
public void setDDLPath(String ddlPath) {
296-
this.ddlPath = ddlPath;
306+
public void setDDLPath(String ddlPath) throws FileNotFoundException {
307+
this.ddlPath = FileUtil.checkPath(ddlPath, "ddlpath");
297308
}
298309

299310
/** A utility method that init the phaseIterator and dialectMap */
@@ -394,8 +405,16 @@ public String toString() {
394405
+ ", driverClass='"
395406
+ driverClass
396407
+ '\''
408+
+ ", reconnectOnFailure="
409+
+ reconnectOnConnectionFailure
410+
+ ", newConnectionPerTxn="
411+
+ newConnectionPerTxn
397412
+ ", batchSize="
398413
+ batchSize
414+
+ ", ddlpath="
415+
+ ddlPath
416+
+ ", sessionSetupFile="
417+
+ sessionSetupFile
399418
+ ", maxRetries="
400419
+ maxRetries
401420
+ ", scaleFactor="

0 commit comments

Comments
 (0)
0