Skip to content

Commit

Permalink
Pin Postgres version in BackendRuntimeParams passed to compiler
Browse files Browse the repository at this point in the history
Force Postgres version in `BackendRuntimeParams` to be the
minimal supported, because the compiler does not rely on
the version, and not pinning it would make the remote compiler
pool refuse connections from clients that have differing versions
of Postgres backing them.
  • Loading branch information
elprans committed Jun 27, 2023
1 parent fb9b7ab commit 9023247
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion edb/server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import immutables
from jwcrypto import jwk

from edb import buildmeta
from edb import errors

from edb.common import devmode
Expand Down Expand Up @@ -552,12 +553,25 @@ def _idle_gc_collector(self):
raise

async def _create_compiler_pool(self):
# Force Postgres version in BackendRuntimeParams to be the
# minimal supported, because the compiler does not rely on
# the version, and not pinning it would make the remote compiler
# pool refuse connections from clients that have differing versions
# of Postgres backing them.
runtime_params = self.get_backend_runtime_params()
min_ver = '.'.join(str(v) for v in defines.MIN_POSTGRES_VERSION)
runtime_params = runtime_params._replace(
instance_params=runtime_params.instance_params._replace(
version=buildmeta.parse_pg_version(min_ver),
),
)

args = dict(
pool_size=self._compiler_pool_size,
pool_class=self._compiler_pool_mode.pool_class,
dbindex=self._dbindex,
runstate_dir=self._internal_runstate_dir,
backend_runtime_params=self.get_backend_runtime_params(),
backend_runtime_params=runtime_params,
std_schema=self._std_schema,
refl_schema=self._refl_schema,
schema_class_layout=self._schema_class_layout,
Expand Down

0 comments on commit 9023247

Please sign in to comment.