You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.
I first note that TransactionContext::SetReadOnly() does not check whether a txn has already executed a query that modified the database when we set the flag. This could lead to problems if somebody calls this incorrectly. It also doesn't make sense to support this functionality because if the system doesn't know that a txn is read-only when it starts, then it won't know whether it is read-only until commit time.
Things to fix:
Remove the default value for the read_only flag in TransactionManager::BeginTransaction().
Remove the TransactionContext::SetReadOnly() method.
We need to think about how we want to set the read-only flag for a
TransactionContext
. There are currently two ways to set this flag:When the txn is created in
TransactionManager::BeginTransaction()
https://github.com/cmu-db/peloton/blob/master/src/include/concurrency/transaction_manager.h#L226-L228
After it has started using
TransactionContext::SetReadOnly()
:https://github.com/cmu-db/peloton/blob/master/src/include/concurrency/transaction_context.h#L273
I first note that
TransactionContext::SetReadOnly()
does not check whether a txn has already executed a query that modified the database when we set the flag. This could lead to problems if somebody calls this incorrectly. It also doesn't make sense to support this functionality because if the system doesn't know that a txn is read-only when it starts, then it won't know whether it is read-only until commit time.Things to fix:
Remove the default value for the
read_only
flag inTransactionManager::BeginTransaction()
.Remove the
TransactionContext::SetReadOnly()
method.Add a
read_only
flag to theTransactionContext
constructors.https://github.com/cmu-db/peloton/blob/master/src/include/concurrency/transaction_context.h#L47-L51
Modify
TimestampOrderingTransactionManager::CommitTransaction()
so that it checks whether a txn has not executed any modifying queries. If so, then it can then be treated as read-only and commit right away. This should happen after we check whether the read-only flag is set.https://github.com/cmu-db/peloton/blob/master/src/concurrency/timestamp_ordering_transaction_manager.cpp#L610
The text was updated successfully, but these errors were encountered: