Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IGNITE-23747 Support timeouts for RO transactions #4902

Open
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

rpuch
Copy link
Contributor

@rpuch rpuch commented Dec 13, 2024

https://issues.apache.org/jira/browse/IGNITE-23747

  • Timeouts for RO transactions are supported
  • Data availability time is used as a default RO transaction timeout
  • After the timeout expires, an RO transaction gets aborted; we rely on existing cleanup mechanism to close remote cursors of this transaction
  • RO transaction is guaranteed to not be aborted automatically until its timeout expires, but it might live longer than its timeout
  • TxManager API has been revamped to make distinction between implicit and explicit transaction initiation more visible

* Timeouts for RO transactions are supported
* Data availability time is used as a default RO transaction timeout
* After the timeout expires, an RO transaction gets aborted; we rely on existing cleanup mechanism to close remote cursors of this transaction
* RO transaction is guaranteed to not be aborted automatically until its timeout expires, but it might live longer than its timeout
* TxManager API has been revamped to make distinction between implicit and explicit transaction initiation more visible
@rpuch rpuch force-pushed the ignite-23747 branch 3 times, most recently from f5fc02f to 3765ce4 Compare December 14, 2024 10:57
@@ -433,6 +433,7 @@ void sql_connection::transaction_start() {
network::data_buffer_owning response =
sync_request(protocol::client_operation::TX_BEGIN, [&](protocol::writer &writer) {
writer.write_bool(false); // read_only.
writer.write((std::int64_t) 0); // timeoutMillis.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
writer.write((std::int64_t) 0); // timeoutMillis.
writer.write<std::int64_t>(0); // timeoutMillis.

@@ -57,6 +57,7 @@ class transactions_impl {
IGNITE_API void begin_async(ignite_callback<transaction> callback) {
auto writer_func = [this](protocol::writer &writer) {
writer.write_bool(false); // readOnly.
writer.write((std::int64_t) 0); // timeoutMillis.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
writer.write((std::int64_t) 0); // timeoutMillis.
writer.write<std::int64_t>(0); // timeoutMillis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants