We could read the last transaction id from CDB by cdb_get_txid(int sock, struct cdb_txid *txid), I think it is a global id for all MO modules.
The problem is for example I got two MOs which are A and B.
- A and B start and read the last transaction id assume A.id = B.id = 1
- now config some leaf in moudle A, A.id is updated, A.id = 2, note that we are not config B
- assume module B restart and read the last transaction id, B.old_id = 1, B.new_id = 2
- module B compare the new and old transaction id, they are not the same, B module re-reading the configuration.(actually, configuration of module B is not changed)
Example 5.3 in confd_user_guide-6.0.pdf shows pseudo code demonstrating how to avoid re-reading the configuration in single module, but virtually there must be multiple modules work together. I think if we could distinguish txid of different modules, the problom is solved.