DoppelGanger++:�Towards Fast Dependency Graph Generation for Database Replay
Wonseok Lee Jaehyun Ha Wook-Shin Han
POSTECH, Korea
Changyoo Park Myunggon Park Juhyeng Han Juchang Lee
SAP Labs Korea
1
1. Database Replay System�2. Problems of Existing Work�3. Our Solution�4. Evaluation
2
Database Replay System (DRS)
3
Production System
Test System
App Servers
REC
Replayer
Capture…
And replay!
workload
Clients
hardware/software
changes
Then detect
Capturing Workload
4
1
2
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Capturing Workload
1. Each user establish a session to the DBMS, before sending the requests.
5
1
2
sessions
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Capturing Workload
2. Each user sends SQL requests to the DBMS, and get the responses.
6
1
2
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Uemp
Semp
Cemp
r1
r2
r3
Capturing Workload
2. Each user sends SQL requests to the DBMS, and get the responses.
7
1
2
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Uemp
Semp
Cemp
r1
r2
r3
Timestamp order (SI)
A request
Capturing Workload
2. Each user sends SQL requests to the DBMS, and get the responses.
8
1
2
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Uemp
Semp
Cemp
r1
r2
r3
Timestamp order (SI)
A request
A Request
Uemp
r1
Request ID
Request Type
S: Select
U: Update
C: Commit (publish updates of a transaction into database state in snapshot isolation)
Database objects
(tables/partitions)
Replaying Workload
The requests in a session are replayed in the timestamp order.
9
Replay Process
Replay Process
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Uemp
Semp
Cemp
r1
r2
r3
r3 returns different results than when capturing.
Q. How to ensure that each request produces the same output as the original run in replay time?
Consistent Replay
The state-of-the-art DRSs supports consistent replay, ensuring output determinism if the test database has no bug.
10
Replay Process
Replay Process
UPDATE emp SET salary=salary*1.1;
COMMIT;
SELECT * FROM emp WHERE salary > 60000;
Uemp
Semp
Cemp
r1
r2
r3
Dependency Graph
DRSs executes the requests in parallel while preserving the ordering in the dependency graph.
11
Uemp
Semp
Cemp
r1
r2
r3
Session 1
Session 2
A request B has an incoming edge from a request A if
Database Replay Workflow
12
Database Replay Workflow
13
Bottleneck (>50%)!
1. Database Replay System�2. Problems of Existing Work�3. Our Solution�4. Evaluation
14
Generate-and-prune Strategy
15
Generate
Prune
Generate-and-prune Strategy
16
Generate
Prune
Here, a direct edge (𝑣, 𝑢) is redundant if removing it still allows 𝑣 to be reached from 𝑢 (i.e., their order is preserved due to other paths).
Generate-and-prune Strategy
17
Generate
Prune
inefficient, generating lots of redundant edges
Repetitive Backward Session Scan (RBSS)
For each request, it finds the latest dependent requests in other sessions using a backward scan.
18
C1
r9
C2
r11
S1
r2
S2
r3
S3
r4
S3
r5
S1
r1
U1
r8
U2
r10
forward scan
Session 1
Session 2
Session 3
backward scans over other sessions (for each request)
...
Problems of RBSS
19
C1
r9
C2
r11
S1
r2
S2
r3
S3
r4
S3
r5
S1
r1
U1
r8
U2
r10
Session 1
Session 2
Session 3
...
repeatedly scanned
1. Database Replay System�2. Problems of Existing Work�3. Our Solution�4. Evaluation
20
Our Approach
21
Two Dominant Redundant Edges
22
Object Transitivity (OT)
Inter-session Transitivity (IT)
A graph without OT and IT is only 5% larger than the minimal one.
Object Transitivity (OT)
OT refers to redundancy due to a path where all requests on the path access a common object.
23
C2,3
r1
U3
r2
U2
r3
U1
r4
U1
r5
S1
r6
C1
r7
S2
r8
C3
r9
S3
r10
C1,2
r11
Paths where all requests access Object 1.
Redundant due to Object Transitivity (OT).
Inter-session Transitivity (IT)
IT refers to redundancy due to a path through requests in two sessions.
24
C2,3
r1
U3
r2
U2
r3
U1
r4
U1
r5
S1
r6
C1
r7
S2
r8
C3
r9
S3
r10
C1,2
r11
Paths where all requests are in Sessions 1,2
Redundant due to
Inter-session Transitivity (IT)
Taxonomy of the Dependency Graphs
25
Stateful Single Forward Scan (SSFS)
26
single forward scan
with states
Parallel SSFS (PSSFS)
27
Dependency Graph
Local Dependency Graph
Local Dependency Graph
Local Dependency Graph
Local Dependency Graph
Local Dependency Graph
Local Dependency Graph
divide-and-conquer
1. Database Replay System�2. Problems of Existing Work�3. Our Solution�4. Evaluation
28
Experimental Setting
Hardware
Workloads
29
Measures
Competitors
Experimental Results�Overall Time Breakdown
30
TPC-C, 15 minutes, 64 clients
TPC-C, 15 minutes, 256 clients
Experimental Results�Dependency Graph Generation when varying # of clients in TPC-C
31
Dependency Graph Generation Time
Graph Size
Experimental Results�Scalability
32
Conclusion
33