policy rule head can have conflict definations

Bug #1484015 reported by Yingxin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
congress
Fix Released
Undecided
Yingxin

Bug Description

Multiple rules can define a same tablename in its head with different numbers of columns inside. And congress do not check it.

For example, following commands can be both executed without warning:
$openstack congress policy rule create classification "error(ins_name) :- nova:servers(a,ins_name,c,d,e,f,g,'1')"
$openstack congress policy rule create classification "error(id, ins_name) :- nova:servers(id,ins_name,c,d,e,f,g,'1')"

Yingxin (cyx1231st)
Changed in congress:
assignee: nobody → Yingxin (cyx1231st)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to congress (master)

Fix proposed to branch: master
Review: https://review.openstack.org/213283

Changed in congress:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to congress (master)

Reviewed: https://review.openstack.org/213283
Committed: https://git.openstack.org/cgit/openstack/congress/commit/?id=74221cd4be16868c28204c28b950fe7a24a2cf28
Submitter: Jenkins
Branch: master

commit 74221cd4be16868c28204c28b950fe7a24a2cf28
Author: Yingxin Cheng <email address hidden>
Date: Sat Aug 15 01:40:24 2015 +0800

    Fixes the potential conflictions in rule creation

    Currently, the PE does not check whether the inserted rule/fact has
    confliction with existing rules/facts in target theory. Moreover, rule&fact
    confliction will cause engine to an inconsistency state if user tries to
    'policy row list' the conflicted table.

    This patch prevents and reports confliction when following rule/fact creation
    happens: (see tests.datalog.test_nonrecur.TestRuntime.test_insert())
    1) report rule&rule conflict
    2) report rule&fact conflict
    3) report fact&rule conflict
    4) report fact&fact conflict
    5)* report body conflict
    6)* conflict check accross policies

    *This patch also enables up-to-date schema of Theories. It records each
    rule insertion and deletion, and results in a low performance impact in
    "test_agnostic_performance".

    Change-Id: I9e85eda8688987f45dd941327e39caa7cebba978
    Closes-Bug: #1484015

Changed in congress:
status: In Progress → Fix Committed
Tim Hinrichs (thinrichs)
Changed in congress:
milestone: none → liberty-rc2
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.