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

Remove callmemaybe bits from compute #172

Merged
merged 1 commit into from
Jun 10, 2022
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
28 changes: 0 additions & 28 deletions contrib/neon/libpagestore.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,25 +71,6 @@ zenith_connect()
errdetail_internal("%s", msg)));
}

/* Ask the Page Server to connect to us, and stream WAL from us. */
if (callmemaybe_connstring && callmemaybe_connstring[0]
Copy link
Member

Choose a reason for hiding this comment

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

BTW it's possible to repurpose this code to help with old ps-1 version that requires callmemaybe.

Compute can send callmemaybe to the pageserver with the following content:

callmemaybe tenant timeline any_sk_address

It will trick old pageserver into connecting to new safekeeper and can work until we implement a more complex migration.

Copy link
Author

Choose a reason for hiding this comment

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

Yes, that's what I've thought was possible and tried to advertise that a few days ago, but so far the consensus was to move on and purge/bump ps-1 after we notify external users about this event.
This way, we don't have to add anything at all in the code 🙂

Choose a reason for hiding this comment

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

@petuhovskiy AFAIK In current setup compute does not send callmemaybe connstr to pageserver. It is the leftover of old setup that allowed to run without safekeepers, so should be ok to remove that entirely.

Copy link
Member

Choose a reason for hiding this comment

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

It is the leftover of old setup that allowed to run without safekeepers, so should be ok to remove that entirely.

Yeah, I'm talking about hacking it to work in a new way.

but so far the consensus was to move on and purge/bump ps-1 after we notify external users about this event.

ps-1 on staging can be deleted, but on production we have to do migration somehow. Hacking callmemaybe in compute can be an alternative.

Copy link
Contributor

Choose a reason for hiding this comment

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

That would be an option, but direct compute->pageserver also has neondatabase/neon#1068 pit (apart from risk of losing data without safekeepers). So yes, let's do migration.

Copy link
Member

Choose a reason for hiding this comment

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

We can don't do direct compute->pageserver START REPLICATION, and just ping pageserver with safekeeper address, so old pageserver will know one safekeeper where it needs to connect.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, indeed

&& zenith_tenant
&& zenith_timeline)
{
PGresult *res;

query = psprintf("callmemaybe %s %s %s", zenith_tenant, zenith_timeline, callmemaybe_connstring);
res = PQexec(pageserver_conn, query);
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
PQfinish(pageserver_conn);
pageserver_conn = NULL;
zenith_log(ERROR,
"[ZENITH_SMGR] callmemaybe command failed");
}
PQclear(res);
}

query = psprintf("pagestream %s %s", zenith_tenant, zenith_timeline);
ret = PQsendQuery(pageserver_conn, query);
if (ret != 1)
Expand Down Expand Up @@ -383,15 +364,6 @@ _PG_init(void)
0, /* no flags required */
NULL, NULL, NULL);

DefineCustomStringVariable("neon.callmemaybe_connstring",
"Connection string that Page Server or WAL safekeeper should use to connect to us",
NULL,
&callmemaybe_connstring,
"",
PGC_POSTMASTER,
0, /* no flags required */
NULL, NULL, NULL);

DefineCustomStringVariable("neon.timeline_id",
"Zenith timelineid the server is running on",
NULL,
Expand Down
1 change: 0 additions & 1 deletion contrib/neon/pagestore_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ typedef struct
extern page_server_api *page_server;

extern char *page_server_connstring;
extern char *callmemaybe_connstring;
extern char *zenith_timeline;
extern char *zenith_tenant;
extern bool wal_redo;
Expand Down
1 change: 0 additions & 1 deletion contrib/neon/pagestore_smgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ page_server_api *page_server;

/* GUCs */
char *page_server_connstring; // with substituted password
char *callmemaybe_connstring;
char *zenith_timeline;
char *zenith_tenant;
bool wal_redo = false;
Expand Down