There is no functional relation cache during XLog replay therefore GetMasterKey() would fail looking for the keyring namespace. Actually, it would fail earlier on get_master_key_info_path() as XLog replay has its own MyDatabaseId and MyDatabaseTableSpace. The latter could be fixed by providing RelFileLocator to GetMasterKey() but the former can't be fixed easily (if it could be fixed at all) as XLog replay deals with the Buffer and shouldn't have access to the relations. To solve this, we should pass the master key name in the XLog so there is no need to call GetMasterKey() during XLog redo.
It also doesn't make sense to add an internal key to the cache during XLog replay as this cache is per-process and it won't be available to any user connections.
There is no functional relation cache during XLog replay therefore
GetMasterKey()
would fail looking for the keyring namespace. Actually, it would fail earlier onget_master_key_info_path()
as XLog replay has its ownMyDatabaseId
andMyDatabaseTableSpace
. The latter could be fixed by providingRelFileLocator
toGetMasterKey()
but the former can't be fixed easily (if it could be fixed at all) as XLog replay deals with theBuffer
and shouldn't have access to the relations. To solve this, we should pass the master key name in the XLog so there is no need to callGetMasterKey()
during XLog redo.It also doesn't make sense to add an internal key to the cache during XLog replay as this cache is per-process and it won't be available to any user connections.