typedb icon indicating copy to clipboard operation
typedb copied to clipboard

Deleted and renamed rules remain unchanged in the LogicCache until commit

Open dmikhalin opened this issue 1 year ago • 0 comments

Description

When we delete or change a Rule using delete() or setLabel() method and then use LogicManager::getRule(), it returns the unchanged rule from the LogicCache. Cache is reindexed only on commit.

Environment

  1. OS (where TypeDB server runs): Mac OS 13.2
  2. TypeDB version (and platform): TypeDB 2.17.0
  3. TypeDB client: client-rust

Reproducible Steps

Steps to create the smallest reproducible scenario:

  1. Create a correct schema with a rule.
  2. Delete rule using Rule::delete().
  3. Get rule by label using LogicManager.

Expected Output

No existing rule.

Actual Output

Rule that was already deleted.

Additional information

We hadn't test scenarios in BDD for rule deleting and renaming. Tests are implemented in this PR: https://github.com/vaticle/typedb-behaviour/pull/250, and corresponding steps have to be implemented in the typedb-core and all clients. Current version of these tests contains commit steps and should pass without changes in typedb-core. After fixing this issue two additional scenarios should be re-enabled.

dmikhalin avatar Jun 15 '23 15:06 dmikhalin