cmu-db / peloton

The Self-Driving Database Management System
http://pelotondb.io
Apache License 2.0
2.03k stars 623 forks source link

Mark Transaction as Read-Only When Executing Single-Statement SELECT #1395

Open apavlo opened 6 years ago

apavlo commented 6 years ago

If we get SELECT query in a single-statement txn, we should mark it as 'read-only'. This will avoid conflicts with other txns that are running at the same time.

I think the only place that we need to change is TrafficCop::ExecuteHelper():

https://github.com/cmu-db/peloton/blob/master/src/traffic_cop/traffic_cop.cpp#L163

I'm not sure how we can write a test case to prove that this is working correctly. I don't know whether we have test cases for running single-stmt txns in the TrafficCop and then being able to see the TransactionContext after the txn commits.

apavlo commented 6 years ago

I will assign this task to @lmwnshn