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

check for replication lag before every statement dispatch #531

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions sources/frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1734,20 +1734,20 @@ static od_frontend_status_t od_frontend_remote(od_client_t *client)
if (status != OD_OK)
break;

/* Check for replication lag and reject query if too big */
od_frontend_status_t catchup_status =
od_frontend_check_replica_catchup(instance,
client);
if (od_frontend_status_is_err(catchup_status)) {
status = catchup_status;
break;
}

server = client->server;

/* attach */
status = od_relay_step(&client->relay);
if (status == OD_ATTACH) {
/* Check for replication lag and reject query if too big */
od_frontend_status_t catchup_status =
od_frontend_check_replica_catchup(instance,
client);
if (od_frontend_status_is_err(catchup_status)) {
status = catchup_status;
break;
}

assert(server == NULL);
status = od_frontend_attach_and_deploy(client, "main");
if (status != OD_OK)
Expand Down
Loading