In an environment of multiple distributed casbin instances with watcher enabled, every time adding policy in one instance, it will broadcast the operation to all other instances, making them to do the add operation too. This will cause "duplicate key error" in underlying database since they are inserting one same rule at the same time.
In an environment of multiple distributed casbin instances with watcher enabled, every time adding policy in one instance, it will broadcast the operation to all other instances, making them to do the add operation too. This will cause "duplicate key error" in underlying database since they are inserting one same rule at the same time.
To solve this issue, there is an option
OnConflict=DoNothing
to set on insert operations.