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

CXXCBC-636: Expose preferred server group replica reads in transaction_context #704

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/transactions/internal/transaction_context.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,9 @@ public:
// These functions just delegate to the current_attempt_context_
void get(const core::document_id& id, async_attempt_context::Callback&& cb);

void get_replica_from_preferred_server_group(const core::document_id& id,
async_attempt_context::Callback&& cb);

void get_optional(const core::document_id& id, async_attempt_context::Callback&& cb);

void insert(const core::document_id& id,
Expand Down
10 changes: 10 additions & 0 deletions core/transactions/transaction_context.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ transaction_context::get(const core::document_id& id, async_attempt_context::Cal
throw transaction_operation_failed(FAIL_OTHER, "no current attempt context");
}

void
transaction_context::get_replica_from_preferred_server_group(const core::document_id& id,
async_attempt_context::Callback&& cb)
{
if (current_attempt_context_) {
return current_attempt_context_->get_replica_from_preferred_server_group(id, std::move(cb));
}
throw transaction_operation_failed(FAIL_OTHER, "no current attempt context");
}

void
transaction_context::get_optional(const core::document_id& id, async_attempt_context::Callback&& cb)
{
Expand Down
Loading