Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
815e96a
Add test case sequence reading and parsing capabilities
Jan 25, 2021
449d8d7
Modify .gitignore -> dbtest *.swp CMakeCache.txt CMakeFiles cmake_ins…
fishheader Jan 25, 2021
829c2b4
Modify .gitignore -> CMakeFiles/* cmake/* *.cmake *Makefile*
fishheader Jan 25, 2021
c8c43db
Add mysql-connector
fishheader Jan 26, 2021
9d60535
jdbc
fishheader Jan 26, 2021
786f838
ODBC connect mysql success
fishheader Jan 27, 2021
0f54745
Update .gitignore
fishheader Jan 27, 2021
2afc053
Support transation processing
fishheader Jan 29, 2021
7a56e31
Support check result; Update t/mysql/*
fishheader Jan 30, 2021
d4bbec3
Fix multi database test
fishheader Feb 17, 2021
f9d6a58
Support mongodb test
fishheader Mar 23, 2021
709abc7
Update test cases
fishheader Apr 20, 2021
1f56a9e
Remove old test cases
AxingguChen Feb 11, 2022
811ea18
Add new test cases
AxingguChen Feb 11, 2022
a52bad5
Add parallel exeuction of transaction queries.
AxingguChen Feb 11, 2022
a1633f2
Update test cases
AxingguChen Mar 23, 2022
c78c25c
Update test cases
AxingguChen Mar 29, 2022
4a7f94c
Put last group of test out of paralell exeuctions
AxingguChen Apr 1, 2022
32e305f
Update test cases
AxingguChen Apr 1, 2022
60fe6df
Clean up and update test cases
AxingguChen Apr 14, 2022
021251a
Clean up
AxingguChen Apr 29, 2022
da7b0a5
Add test cases and result
AxingguChen Apr 30, 2022
6054a01
Update readme
AxingguChen Apr 30, 2022
587616c
Update readme
AxingguChen Apr 30, 2022
c2e28a9
Add mongo test result
AxingguChen May 5, 2022
bc20b6b
Update readme and test case by postgresql
AxingguChen May 13, 2022
bd223f3
Update readme math
AxingguChen May 16, 2022
6954f4b
Add CMake list for generating makefiles
AxingguChen May 19, 2022
b561792
Fix bug, release handle statement for Oracle
AxingguChen May 23, 2022
0e1b047
Clean up, and update supoort DB test one case one init
AxingguChen May 31, 2022
9096b5c
Update typos and crop logo
AxingguChen Jun 1, 2022
41e5372
Fix compilation, add CMakeFiles directory itself to .gitignore, cleanup
Xeonacid Jun 20, 2022
cb95ebd
add release connect handle, remove some configs
AxingguChen Jul 7, 2022
e817b6f
Version 2, execute auto-gen test case, detect cycle by POPs
AxingguChen Jul 15, 2022
8b051be
Add predicate test case by delete and insert
AxingguChen Jul 15, 2022
0e3f1f0
Add generator and checker
AxingguChen Jul 21, 2022
58052c9
Fix the output stream conflict for SELECT
Tsunaou Jul 22, 2022
7ec21e7
Merge pull request #27 from Tsunaou/patch-1
AxingguChen Jul 22, 2022
cbfea56
Merge pull request #25 from Xeonacid/coo-consistency-check-fix-compile
AxingguChen Jul 22, 2022
7d08c7e
Fix minor bugs
AxingguChen Jul 22, 2022
598162d
Merge branch 'coo-consistency-check' of https://github.com/Tencent/3T…
AxingguChen Jul 22, 2022
ee8cc5a
Added dockers installation method
infinity955 Sep 11, 2023
60a459e
fix SQLFreeStmt bug
zzhuncle Sep 20, 2023
3ae6248
Add MariaDB results
zzhuncle Sep 20, 2023
9a1dcec
add comments and docs
zzhuncle Sep 21, 2023
cdbb030
Add comments and docs
zzhuncle Sep 21, 2023
07232ca
Merge pull request #29 from binbincome/coo-consistency-check
AxingguChen Sep 22, 2023
8a9f8b0
Merge pull request #32 from zzhuncle/comments
AxingguChen Sep 22, 2023
965b2be
added comments for dynamic testing
zzhuncle Sep 22, 2023
bde8fc7
Merge pull request #2 from Tencent/coo-consistency-check
zzhuncle Sep 22, 2023
3fd87e6
swap the order of unbind and drop in sql_cntl
zzhuncle Sep 22, 2023
58074da
Merge pull request #3 from Tencent/coo-consistency-check
zzhuncle Sep 22, 2023
683cc16
Merge branch 'comments' of https://github.com/zzhuncle/3TS into comments
zzhuncle Sep 22, 2023
c3ff7d6
Merge pull request #4 from Tencent/coo-consistency-check
zzhuncle Sep 24, 2023
6aede03
Added Cassandra results
zzhuncle Sep 24, 2023
8b17def
Merge pull request #30 from zzhuncle/sql_cntl_bugs
AxingguChen Sep 25, 2023
e37ea53
Fixed Cassandra results and added YugabyteDB results
zzhuncle Sep 25, 2023
b509cc5
Update sql_cntl_v2.cc
zzhuncle Sep 25, 2023
701f13c
Update sql_cntl.cc
zzhuncle Sep 25, 2023
73881d8
Update sql_cntl_v2.cc
zzhuncle Sep 25, 2023
a8fc282
Create README.md
zzhuncle Sep 25, 2023
3f77845
Fixed the test results of YugabyteDB
zzhuncle Oct 4, 2023
5ac2b06
Merge remote-tracking branch 'origin/mariadb' into mariadb
zzhuncle Oct 4, 2023
1d1f91a
Merge pull request #31 from zzhuncle/mariadb
AxingguChen Nov 17, 2023
9d8ae85
Merge pull request #33 from zzhuncle/comments
AxingguChen Nov 17, 2023
cb63c71
Create readme.md
AxingguChen Jun 26, 2024
4f6d577
Update README.md
AxingguChen Jun 27, 2024
8b48430
Update README.md
AxingguChen Jun 27, 2024
4776375
Add files via upload
yhyhdyb Jul 3, 2024
9708b97
add explain file
czyrye Jul 4, 2024
89ff302
add file
czyrye Jul 4, 2024
20de811
add file
czyrye Jul 5, 2024
ef284ff
add 3TS-coo build file within ubuntu18.04
gukj-spel Jul 9, 2024
b90d406
add dbms research documentation
gukj-spel Jul 12, 2024
3145761
feat: support sql_interval parameter as an execution input parameter
Kosthi Jul 15, 2024
79da82e
add static test study documentation
gukj-spel Jul 15, 2024
8a677c5
add english doc
gukj-spel Jul 24, 2024
cbb8dc8
Create dynamicTest.md
yhyhdyb Jul 24, 2024
6ba4dcc
Merge branch 'coo-consistency-check' of https://github.com/yhyhdyb/3T…
yhyhdyb Jul 24, 2024
262ac2f
Update dynamicTest.md
yhyhdyb Jul 24, 2024
145afc1
delete extra code block
gukj-spel Jul 24, 2024
1a179b0
add two columns to describe the isolation level and the concurrency a…
gukj-spel Jul 24, 2024
fe47cae
translate to english
czyrye Jul 24, 2024
2ccc545
translate to english
czyrye Jul 24, 2024
edd361d
translate to english
czyrye Jul 24, 2024
ccac726
add doc to describes three python files about dynamic testing
gukj-spel Jul 25, 2024
7905629
modify english doc
gukj-spel Jul 29, 2024
9672447
Merge pull request #59 from gukj-spel/dynamic_python_doc
AxingguChen Sep 3, 2024
4d77df8
Merge pull request #52 from gukj-spel/static_test_research
AxingguChen Sep 3, 2024
bad10be
Merge pull request #47 from czyrye/coo-consistency-check
AxingguChen Sep 3, 2024
3c6545b
Merge pull request #45 from yhyhdyb/coo-consistency-check
AxingguChen Sep 5, 2024
3e5a266
Merge pull request #49 from gukj-spel/rearch_dbms_doc
AxingguChen Sep 5, 2024
05351c9
Merge pull request #48 from gukj-spel/coo-consistency-check
AxingguChen Sep 5, 2024
20504f4
feat: set the default value of sql_interval to 2000ms
Kosthi Sep 5, 2024
8aa3e59
Merge pull request #51 from Kosthi/coo-consistency-check
AxingguChen Sep 6, 2024
d375584
Update README.md
AxingguChen Jun 16, 2025
bf5a50c
doc: add file list and directory structure
Shining1101 Jul 16, 2025
54bce14
doc: add sqltest_v2.cc overview (main + thread loop)
Shining1101 Jul 17, 2025
2825313
doc: add sql_cntl_v2.cc overview with exact line numbers
Shining1101 Jul 17, 2025
8995a43
doc: add sql_cntl_v2.cc interaction & error handling
Shining1101 Jul 17, 2025
1392461
doc: complete Day5+Day6 content for Issue #69
Shining1101 Jul 28, 2025
f0356c2
fix: add missing Day5+Day6 sections
Shining1101 Jul 28, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
build/*
.vscode/*
*.txt
*.cfg
__*
*.o
Expand All @@ -9,3 +8,10 @@ core*
3ts
rundb
runcl
3ts_dbtest
*.swp
CMakeCache.txt
CMakeFiles/
*.cmake
Makefile
cmake/*
9 changes: 3 additions & 6 deletions AUTHORS.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
Authors ordered by first contribution.

Yuxing Chen <axingguchen@tencent.com>
Yu Li <farrisli@tencent.com>
Chang Liu <williamcliu@tencent.com>
ZhanHao Zhao <zhanhaozhao@ruc.edu.cn>
HongYao Zhao <hongyaozhao@ruc.edu.cn>
GuangLin Ma <moggma@tencent.com>
Ming Yan <elioyan@tencent.com>
Xinpeng Chen <xenitchen@tencent.com>
75 changes: 0 additions & 75 deletions README-zh.md

This file was deleted.

171 changes: 117 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,72 +4,135 @@

![](https://img.shields.io/badge/license-GPLv3-brightgreen)

**Tencent Transaction Processing Testbed System (3TS)** that is jointly developed by Tencent's CynosDB (TDSQL) team and the Key Laboratory of Data Engineering and Knowledge Engineering of the Ministry of Education of Renmin University of China. The system aims to design and construct a unified framework for transaction processing (including distributed transactions). It enables users to quickly build new concurrency control approaches via the access interface provided by the framework. Based on an comprehensive experiment study over the benchmarks, and the applications abstracted, users can select an optimal concurrency control approach. At present, 3TS has been integrated 13 mainstream concurrency control approaches, and provides common benchmarks such as TPC-C、PPS and YCSB. 3TS further provides a consistency level test benchmark, to address the issue of system selection difficulty caused by the blowout development of distributed database systems, and provides consistency level discrimination and performance test comparison.
**Tencent Transaction Processing Testbed System (3TS)** that is jointly developed by Tencent's CynosDB (TDSQL) team and the Key Laboratory of Data Engineering and Knowledge Engineering of the Ministry of Education of Renmin University of China. The system aims to design and construct a unified framework for transaction processing (including distributed transactions). It enables users to quickly build new concurrency control approaches via the access interface provided by the framework. Based on an comprehensive experiment study over the benchmarks, and the applications abstracted, users can select an optimal concurrency control approach. At present, 3TS has been integrated 13 mainstream concurrency control approaches, and provides common benchmarks such as TPC-C, PPS, and YCSB. 3TS further provides a consistency level test benchmark, to address the issue of system selection difficulty caused by the blowout development of distributed database systems, and provides consistency level discrimination and performance test comparison.

If you want to better understand the aims of our project, please view [3TS opensource announcement](doc/en/announcement.md).

## Features
## Coo: Consistency Check

1. Support three ways to generate histories: Traversing Generating, Randomly Generating, Generating From the Text File.
2. Built-in multiple algorithms, including Serializable Algorithm, Conflict Serializable Algorithm, SSI, BOCC, FOCC, etc.
3. Support evaluating algorithm cost from the execution time and rollback rate two perspectives.
To test the consistency of real databases.
We generate the anomaly histories, and simulate multi-users transaction requesting to databases.

## Dependence
Check out some test cases (e.g., [Dirty Write](test_result/test_cases/wat_sda_dirty_write_2commit.txt)) and result (e.g., [passed by MySQL](test_result/centralizend_result/mysql/serializable/wat_sda_dirty_write_2commit.txt) at Serializable Level).

### 3TS-DA
You can explore all results on [report webpage](https://axingguchen.github.io/3TS/).

- a compilter supporting C++17 or upper versions (recommend g++8)
- libconfig 1.7.2
- gflags 2.1.1
- gtest 1.6.0
Paper from the project:

### Deneva
- VLDB'23: [PolySI: Efficient Black-box Checking of Snapshot Isolation in Databases](https://github.com/hengxin/PolySI-PVLDB2023-Artifacts)

- VLDB'24 DEMO: [IsoVista: Black-box Checking Database Isolation Guarantees](https://github.com/hengxin/IsoVista)

- ICDE'25: [Boosting End-to-End Database Isolation Checking via Mini-Transactions](https://www.computer.org/csdl/proceedings-article/icde/2025/360300d998/26FZCeQ3uJW)

- ICDE'25: [Online Timestamp-Based Transactional Isolation Checking of Database Systems](https://www.computer.org/csdl/proceedings-article/icde/2025/360300d738/26FZC0ImYsU)

- protobuf 3.9.1
- curl 7.29.0
- nanomsg 5.1.0

## Usage
Provide two installation methods for the project environment: **Docker** and **Compilation**, and you can freely choose the installation method.

### Docker installation

If you have not installed Docker, you can use the following command to install it with one click.

```shell
curl -s https://get.docker.com/ | sh
```

Obtain Mirror

```shell
docker pull registry.cn-hangzhou.aliyuncs.com/open_projects/3ts_coo:1.0
```

Obtain Mirror to view the image ID and generate a container based on the image ID

```shell
docker images
docker run -it [image_id] /bin/bash
```

View all containers and enter the generated container

```shell
docker ps -a
docker exec -it [container_id] /bin/bash
```

### Compile Installation

To generate Makefile (all commands are executed under '3TS/src/dbtest'):

```
cmake -S ./
```

To complie the code:

```
make
```

## Example

If using Docker installation, the container defaults to installing and configuring the database PostgreSQL,Start it using the following command (if you choose to compile the installation method, you need to install the database and configure it):

```shell
/etc/init.d/postgresql start
```

For test cases, it specify in "do_test_list.txt". Use "#" to exclude (comment) the test case.
We provide three levels of test cases, i.e., the basic cases (33 anomalies in the paper), the predicate cases, and the MDA cases (with multiple transactions and objects). For specific test cases to evaluate, we specify it in do_test_list.txt.

```
// to test all test cases
cp t/bk_do_test_list_all.txt do_test_list.txt

// to test only basic cases
cp t/bk_do_test_list_basic.txt do_test_list.txt

// to test only predicate cases
cp t/bk_do_test_list_predicate.txt do_test_list.txt
```

Edit "auto_test.sh" for database configurations (e.g., username, password). Edit "auto_test_all.sh" for database (e.g., PostgreSQL, and MySQL) and isolation (e.g., SERIALIZABLE, REPEATABLE READ, READ COMMITTED, and READ UNCOMMITTED) configuration.


To run the test (under '3TS/src/dbtest'):
```
./auto_test_all.sh
```

## Analyze an anomaly case run by PostgreSQL

### Setup PostgreSQL
Please check out the general environment [setup](doc/en/setup_db_environment) and PostgreSQL [setup](doc/en/setup_db_postgresql).

Check if it successfully connects to PostgreSQL server by isql,
```
isql pg -v
```
Once the connected information showed, we are able to run our code to test designed anomaly schedules.

Under "src/dbtest/" folder, add rat_dda_write_read_skew and rat_dda_write_read_skew_committed to "do_test_list.txt".
Add the following to "auto_test_all.sh" for running PostgreSQL with four isolation levels:
```
./auto_test.sh "pg" "read-uncommitted"
./auto_test.sh "pg" "read-committed"
./auto_test.sh "pg" "repeatable-read"
./auto_test.sh "pg" "serializable"
```
Run test by "./auto_test_all.sh". The test result are in the following:
| Isolation level | Write-read Skew ([SQL](test_result/test_cases/rat_dda_write_read_skew.txt)) | Write-read Skew Committed ([SQL](test_result/test_cases/rat_dda_write_read_skew_committed.txt)) |
| ----------- | ----------- | ----------- |
| Serializable | Rollback ([result](test_result/centralizend_result/pg/serializable/rat_dda_write_read_skew.txt)) | Rollback ([result](test_result/centralizend_result/pg/serializable/rat_dda_write_read_skew_committed.txt)) |
| Repeatable Read | Anomaly reported ([result](test_result/centralizend_result/pg/repeatable-read/rat_dda_write_read_skew.txt)) | Anomaly reported ([result](test_result/centralizend_result/pg/repeatable-read/rat_dda_write_read_skew_committed.txt)) |
| Read (Un)Committed | Anomaly reported ([result](test_result/centralizend_result/pg/read-committed/rat_dda_write_read_skew.txt)) | Pass the test ([result](test_result/centralizend_result/pg/read-committed/rat_dda_write_read_skew_committed.txt)) |

At serializable level, both tested cases detected consecutive RW conflicts.
At Repeatable Read level, both generated two consecutive RW conflicts and allowed.
At Read (Un)Committed level, Write-read Skew test case generated two consecutive RW ($R_2W_1,R_1W_2$) conflicts while Write-read Skew Committed test case read the newest committed version and executed into non-anomaly schedule ($R_2W_1,W_2C_2R_1$).

- Run `make.sh` to compile the code. The `3ts` binary will be generated if compiling successfully.
- Run `cp config/config.cfg.template config.cfg` to copy the configuration file.
- Run `vi config.cfg` to modify the configuration file to determine the behavior of the testbed.
- Run `./t3s --conf_path=config.cfg` to execute test. The test result file will be generated when test is over.

## Principle

3TS framework can be divided into four parts:

- Runner: To determine the behavior of the testbed. The testbed now supports two runners. Please specify the runner behind the `Target` configuration item, e.g. `Target = ["FilterRun"]`.
- `FilterRun`: To output the detection result from each algorithms with each history and the result can be filtered.
- `BenchmarkRun`: To test performance by outputting the time cost of each algorithm detecting anomalies from the same number of histories in different transaction numbers and variable item numbers.
- Generator: To generate histories.
- Algorithm: To detect anomalies in each history generated by Generator. The testbed supports following algorithms:
- Serializable Algorithm (Judge whether the history is serializable or not based on the definition of serializable. But the standard to **check the consistency between the execution results of concurrent history and serialized history** and **the read strategy of each transaction** are different.):
- The Serializable Algorithms based on standard that **every correspond transactions' read set** and **every correspond variable items' final version** are all same in the four read strategies.
- `"SerializableAlgorithm_ALL_SAME_RU"` // uncommitted read strategy
- `"SerializableAlgorithm_ALL_SAME_RC"` // committed read strategy (read the latest committed version by which naturally avoid the unserializable cases caused by **dirty read** anomaly)
- `"SerializableAlgorithm_ALL_SAME_RR"` // repeatable read strategy (read the previous version when second reading the same variable item in the same transaction by which naturally avoid the unserializable cases caused by **non-repeatable read anomaly**)
- `"SerializableAlgorithm_ALL_SAME_SI"` // snapshot read strategy (naturally avoid the unserializable cases caused by **phantom anomaly**)
- The Serializable Algorithms based on standard that **the every committed correspond transactions' read set** and **every correspond variable items' final version** are all same in the four read strategies.
- `"SerializableAlgorithm_COMMIT_SAME_RU"` // uncommitted read strategy
- `"SerializableAlgorithm_COMMIT_SAME_RC"` // committed read strategy
- `"SerializableAlgorithm_COMMIT_SAME_RR"` // repeatable read strategy
- `"SerializableAlgorithm_COMMIT_SAME_SI"` // snapshot read strategy
- The Serializable Algorithms based on standard that only **the every correspond variable items' final version** are same in the four read strategies.
- `"SerializableAlgorithm_FINAL_SAME_RU"` // uncommitted read strategy
- `"SerializableAlgorithm_FINAL_SAME_RC"` // committed read strategy
- `"SerializableAlgorithm_FINAL_SAME_RR"` // repeatable read strategy
- `"SerializableAlgorithm_FINAL_SAME_SI"` // snapshot read strategy
- Conflict Serializable Algorithm:`"ConflictSerializableAlgorithm"`
- Serializable Snapshot Isolation:`"SSI"`
- Write-Snapshot Isolation:`"WSI"`
- Backward Optimistic Concurrency Control:`"BOCC"`
- Forward Optimistic Concurrency Control:`"FOCC"`

- Outputter: To statistics the results and output to the specific file.

**For explanations to other configuration items, please view the comments in configuration file.**

## License

Expand Down
Binary file modified assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/overflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading