sonic-net / sonic-swss

SONiC Switch State Service (SwSS)
https://azure.github.io/SONiC
Other
171 stars 519 forks source link

Failed to create ACL rule when ACL table is not created #209

Open stcheng opened 7 years ago

stcheng commented 7 years ago

In aclorch.cpp line 1014, it checks the table_oid. When table is not yet create, we cannot get the table_oid and we need to wait for the table to be created instead of dropping this task away.

andriymoroz-mlnx commented 7 years ago

What if by mistake table will never be created? Need to check whether consumer logic isn't broken if some doTask() will leave a record in consumer.m_toSync. Are there any cases in other daemons we skip erasing some entries from consumer.m_toSync?

stcheng commented 7 years ago

yes. there any many examples that some tasks are not erased but waiting for dependencies. this fix is added because different tables are processed independently without guaranteeing the orders across different tables. it is possible that rules are processed before tables are processed and rules will be lost.

later callback logics will be added to replace the current retry logic.

liatgrozovik commented 7 years ago

I don't think that from the user perspective and rule should be created before it creates the table. table should be first created and only then rules should be added. this also goes on the delete flow. you should delete a table only if all the rules associated to it will be removed first.

stcheng commented 7 years ago

Let us first do the quick fix and then have a further discussion on what is the best way to resolve the above scenario.