-
-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the reset_follower management command #13
base: main
Are you sure you want to change the base?
Conversation
Thanks for doing this. It all looks very neat and tidy, and useful! The only thought I have, which I'm sure you have thought about already, is that in some cases deleting the tracking records, without also deleting the consequential state of processing the events that have been tracked, might lead to a state in which the events cannot be reprocessed. For example, if a "created" event has been processed by inserting a record, coded under the assumption that there isn't already a record, and attempting to insert such a record twice causes an integrity error. Regarding your question: it makes good sense to deal with the database records, since if there are no records for a particular application name, then there are no recorded to delete, and locating the system runner in all cases is most likely going to be a tricky business? Please carry on with this. I like it. |
This is entirely correct, and that is an important point the documentation should not miss.
The first iteration I explored for this command was actually expecting the I do use an added "reset method" in my own examples to prepare the ORM models when the I will dig into supporting an additional (optional!*) protocol that offers a reset hook, think something like: class ResetableFollower(Protocol):
def on_reset(cls):
... *: I feel quite strongly against name-squatting a method name unless it has been explicitly configured. |
Add a new Django management command, `reset_follower`, that can manually reset the tracking states of a follower (i.e. a ProcessApplication instance). The idea for the follower is to replay the whole history next time it is (manually) synchronised. Note that this command does not interact with a running system, see the command `sync_followers` to nudge the system in catching up with the upstream apps.
3241c06
to
37278a0
Compare
Updated the command tests for coverage (also output) and support for specifying which upstream app(s) to reset the tracking states of. |
Hey @bibz! Did you make any progress with this? Hope all is well with you :) |
Hi @johnbywater! Sorry for the long silence I was busy elsewhere. |
No worries @bibz! Thanks for replying. More than happy to have a meeting about it, if you think that would help. |
Add a new Django management command,
reset_follower
, that can manually reset the tracking states of a follower (i.e. a ProcessApplication instance). The idea for the follower is to replay the whole history next time it is (manually) synchronised.Note that this command does not interact with a running system, see the command
sync_followers
to nudge the system in catching up with the upstream apps.@johnbywater This is the change I mentioned last week. I did not make any more changes to it but I think it's worth pushing now to open up the discussion (or let me know if you'd rather discuss in an issue thread first).
TODO:
using
)Open questions: