neon icon indicating copy to clipboard operation
neon copied to clipboard

Epic: prohibit `CREATE TABLESPACE` in neon

Open kelvich opened this issue 1 year ago • 2 comments

Motivation

That doesn't properly work with Neon and if we accept that we are not supporting it we might use i128 for page tag.

DoD

Implementation ideas

add

case T_CreateTableSpaceStmt:
   ereport(ERROR,
                (errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
                 errmsg("CREATE TABLESPACE statements are not supported by Neon.")));
   break;

to switch statement in https://github.com/neondatabase/neon/blob/cbe8c77997aea576a96a7f8d31147cb7a11d6a6b/pgxn/neon/control_plane_connector.c#L783

kelvich avatar Aug 08 '24 09:08 kelvich

This is complete once https://github.com/neondatabase/neon/pull/8648 lands (with nice behavior for stopping ingest if it sees a key it can't read)

jcsp avatar Aug 19 '24 13:08 jcsp

One interesting observation is that solely doing create tablespace does not reproduce the invalid key error. Next step is to understand what will happen if an invalid key is written to Neon, and get https://github.com/neondatabase/neon/pull/8648 merged.

skyzh avatar Aug 26 '24 13:08 skyzh

https://github.com/neondatabase/neon/pull/8648 now rejects keys on the write path while https://github.com/neondatabase/neon/pull/8657 disables the statement. Closing the issue for now. Follow-up is how does safekeeper handle pageserver key rejections, currently this is causing infinite retries.

skyzh avatar Aug 29 '24 19:08 skyzh