-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Request additional sync point on discard. (#584)
* Drop bin, add gitignore * Request additional sync point on discard. * Update sources/reset.c Co-authored-by: Yury Frolov <[email protected]> --------- Co-authored-by: Yury Frolov <[email protected]>
- Loading branch information
Showing
6 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
pstst | ||
psmst |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ set(od_src | |
deploy.c | ||
reset.c | ||
frontend.c | ||
backend_sync.c | ||
backend.c | ||
instance.c | ||
main.c | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* | ||
* Odyssey. | ||
* | ||
* Scalable PostgreSQL connection pooler. | ||
*/ | ||
|
||
#include <kiwi.h> | ||
#include <machinarium.h> | ||
#include <odyssey.h> | ||
|
||
int od_backend_request_sync_point(od_server_t *server) | ||
{ | ||
od_instance_t *instance = server->global->instance; | ||
int rc; | ||
|
||
machine_msg_t *msg; | ||
msg = kiwi_fe_write_sync(NULL); | ||
if (msg == NULL) { | ||
return -1; | ||
} | ||
rc = od_write(&server->io, msg); | ||
if (rc == -1) { | ||
od_error(&instance->logger, "sync-point", server->client, | ||
server, "write error: %s", od_io_error(&server->io)); | ||
return NOT_OK_RESPONSE; | ||
} | ||
|
||
/* update server sync state */ | ||
od_server_sync_request(server, 1); | ||
|
||
return od_backend_ready_wait(server, "sync-point", 1 /*count*/, | ||
UINT32_MAX /* timeout */, | ||
0 /*ignore error?*/); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef ODYSSEY_BACKEND_SYNC_H | ||
#define ODYSSEY_BACKEND_SYNC_H | ||
|
||
/* | ||
* Odyssey. | ||
* | ||
* Scalable PostgreSQL connection pooler. | ||
*/ | ||
|
||
int od_backend_request_sync_point(od_server_t *); | ||
|
||
#endif /* ODYSSEY_BACKEND_SYNC_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters