Welcome to the Microsoft Q&A (Preview) platform. Happy to answer your questions.
Currently, notifications fire on all replicas when the changes show up.
This means in your code, you can either
- Not hook up the notifications on secondary replicas or unhook the notifications when the replicas become secondaries (and rehook them when becoming primary)
- Discard the notifications that fire on the secondaries Both would require adding an override to OnChangeRoleAsync
You can follow this document for more information.