diff --git a/edb/common/debug.py b/edb/common/debug.py index 6d9ed365dd6..051959e656c 100644 --- a/edb/common/debug.py +++ b/edb/common/debug.py @@ -176,7 +176,7 @@ class flags(metaclass=FlagsMeta): zombodb = Flag(doc="Enabled zombodb and disables postgres FTS") - persistent_cache = Flag(doc="Use persistent cache") + disable_persistent_cache = Flag(doc="Don't use persistent cache") # Function cache is an experimental feature that may not fully work func_cache = Flag(doc="Use stored functions for persistent cache") diff --git a/edb/server/compiler/compiler.py b/edb/server/compiler/compiler.py index 327bedd3ebc..3d9109b225a 100644 --- a/edb/server/compiler/compiler.py +++ b/edb/server/compiler/compiler.py @@ -870,7 +870,7 @@ def compile_request( request.protocol_version, request.inline_objectids, request.json_parameters, - persistent_cache=bool(debug.flags.persistent_cache), + persistent_cache=not debug.flags.disable_persistent_cache, cache_key=request.get_cache_key(), ) return units, cstate @@ -976,7 +976,7 @@ def compile_in_tx_request( request.inline_objectids, request.json_parameters, expect_rollback=expect_rollback, - persistent_cache=bool(debug.flags.persistent_cache), + persistent_cache=not debug.flags.disable_persistent_cache, cache_key=request.get_cache_key(), ) return units, cstate diff --git a/edb/server/dbview/dbview.pyx b/edb/server/dbview/dbview.pyx index 7ef1f5c2b02..3b9e6c29db1 100644 --- a/edb/server/dbview/dbview.pyx +++ b/edb/server/dbview/dbview.pyx @@ -200,7 +200,7 @@ cdef class Database: query_req, unit_group = self._eql_to_compiled.cleanup_one() if len(unit_group) == 1: keys.append(query_req.get_cache_key()) - if keys and debug.flags.persistent_cache: + if keys and not debug.flags.disable_persistent_cache: self.tenant.create_task( self.tenant.evict_query_cache(self.name, keys), interruptable=True, @@ -275,7 +275,8 @@ cdef class Database: async with self._introspection_lock: if self.user_schema_pickle is None: await self.tenant.introspect_db( - self.name, hydrate_cache=debug.flags.persistent_cache + self.name, + hydrate_cache=not debug.flags.disable_persistent_cache, ) @@ -713,7 +714,7 @@ cdef class DatabaseConnectionView: if not self._in_tx: self._db._cache_compiled_query(key, query_unit_group) - elif not self._in_tx_with_ddl and not debug.flags.persistent_cache: + elif not self._in_tx_with_ddl and debug.flags.disable_persistent_cache: self._db._cache_compiled_query(key, query_unit_group) # Query compiled in transaction is not yet cached when persistent_cache # is turned on, because eviction of such query would fail if the tx diff --git a/edb/server/protocol/execute.pyx b/edb/server/protocol/execute.pyx index 02f491bdde1..cbd6d3a66fb 100644 --- a/edb/server/protocol/execute.pyx +++ b/edb/server/protocol/execute.pyx @@ -184,7 +184,7 @@ async def execute( # This flag indicates both features are in use, and we actually have # recompiled the query cache to persist. persist_recompiled_query_cache = bool( - debug.flags.persistent_cache and compiled.recompiled_cache) + not debug.flags.disable_persistent_cache and compiled.recompiled_cache) data = None