Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Conversation

@hbdeshmukh
Copy link
Contributor

Hello,

This PR has some skeleton code for basic transactional queries support in quickstep. This PR follows the design proposed in the presentation attached with https://issues.apache.org/jira/browse/QUICKSTEP-107.

@hbdeshmukh
Copy link
Contributor Author

@pateljm @zuyu @jianqiao Can you take a look at these changes whenever possible? Thanks.

Copy link
Member

@zuyu zuyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done one pass.

Also, I hope there will be some follow-up PRs regarding how to use these two new base classes, as it seems incomplete to me even for the API design, let alone the integration to the query optimizer and the execution engine.

/**
* @brief Return all the base relations referenced in this query.
**/
std::vector<relation_id> getAllReferencedBaseRelations() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should mark as a const method, and I think we need to add a data member called referenced_base_relations_.

#define QUICKSTEP_TRANSACTION_ADMISSION_CONTROL_HPP_

#include "utility/Macros.hpp"
#include "transaction/TransactionTable.hpp"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabet order.

* @param transaction_table A lookup table that stores information about
* all the running and waiting transactions.
*/
AdmissionControl(TransactionTable *transaction_table) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add explicit.

I was wondering which object will own transaction_table. And does this class need to store the pointer?

Also, should this class contain the CompatibilityChecker object?

*/
virtual bool admitWaitingTransaction(const transaction_id tid) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionally, I think it is better to mark these two APIs as pure virtual methods.

} // namespace transaction
} // namespace quickstep

#endif //QUICKSTEP_TRANSACTION_ADMISSION_CONTROL_HPP_
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a whitespace after //.

quickstep_transaction_Transaction
quickstep_transaction_CompatibilityChecker
quickstep_transaction_TransactionTable)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert this change.

* @param transaction_table A lookup table that stores information about
* all the running and waiting transactions.
*/
CompatibilityChecker(TransactionTable *transaction_table) {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add explicit.

const std::vector<block_id> &blocks,
const AccessMode access_mode) {
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optionally, mark as pure virtual methods.


private:
DISALLOW_COPY_AND_ASSIGN(CompatibilityChecker);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this empty line.

} // namespace transaction
} // namespace quickstep

#endif //QUICKSTEP_TRANSACTION_TRANSACTION_COMPATIBILITY_CHECKER_HPP_ No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a whitespace after //, and add EOL in the end.

@jianqiao
Copy link
Contributor

The design looks good to me! It would be better to fast forward to subsequent PRs to see the actual usage.

- CompatabilityChecker base class in transaction checks the
  compatability of an incoming transaction with other running
  transactions.
- AdmissionControl base class decides whether to admit or waitlist an
  incoming transaction.
- QueryHandle class provides a method to list all the base relations
  referenced in a transaction.
- Locks can be on CatalogRelation as well as individual blocks.
@hbdeshmukh hbdeshmukh force-pushed the concurrent-queries-transactions branch from 8f94489 to a5eccaf Compare November 27, 2017 17:14
- Locks entire database in an exclusive lock for any query.
- Rules for finding referenced base relations for an input logical plan.
- Changes in PolicyEnforcer to admit queries from the transaction's
  admission control.
@hbdeshmukh hbdeshmukh force-pushed the concurrent-queries-transactions branch from a5eccaf to 2ed20c1 Compare November 27, 2017 19:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants