-
Notifications
You must be signed in to change notification settings - Fork 11
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
adding backup targets #170
Conversation
Codecov Report
@@ Coverage Diff @@
## main #170 +/- ##
==========================================
+ Coverage 90.00% 90.19% +0.19%
==========================================
Files 24 24
Lines 5100 5203 +103
==========================================
+ Hits 4590 4693 +103
Misses 510 510
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Just couple of small thoughts that can be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one styling comment.
I also tested that the |
One thing I forgot to ask for: example configuration. Which made me realise that the original primary |
Ah, crap. You are right. |
The implementation I came up with does not work at all. |
So, I think I will revert all of this work and start over. Maybe I'll start a new PR to add the Then I need a sanity check. I think I will implement the backup target if I hit here: https://github.com/pytroll/trollmoves/blob/main/trollmoves/client.py#L671 So the idea is then to, if backup targets/destinations config is provided, restart the request. Any ideas? |
I would keep the structure you have here, but instead of putting the backup destinations to Server config, put them in Client config and add them in the request message maybe in this else block. Then in Server check the message for |
Ah, yes. That looks doable. So, where is this tested then. Then I can try from there |
Updated to have the backup targets config in the client config. Please let me know id you see anything odd |
This is a tricky one. The message should maybe be updated here, but that would require rather large changes so that the actual destination were passed down from the individual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just couple of small comments inline, otherwise LGTM.
The comment on the config made me think that later we could move the retry logic to movers.move_it()
so that all of the movers would have the possibility. Then we could also have backup destinations with different transport schemes; the primary could be scp://
and backups scp://
and ftp://
for example. But that's for another PR.
I'm quite happy with this. Please let me know what you think |
A step further. What do you think? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple more things. And a live test would be great 😁
You mean at the status update? And show this is working on the screen? Sure no problem. |
No need to demonstrate 😂 Just run a test that this works in real life. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Does @mraspaud want to have a look?
Then I see something that might be a feature. First time a backup target is used, the active connection is tagged with the primary target. Therefore the next time, if the previous connection is still alive, this is used even if the actual connection is to the backup target. SO that way if this occur it looks like the primary target is used but the actual cache connection is to the bakcup target. changing line https://github.com/pytroll/trollmoves/blob/main/trollmoves/movers.py#L136 to |
Not sure if this is ready to merge as I see the approval from @mraspaud is old/changes after the approval. |
I'm merging this, we need a new release with the |
AUTHORS.md
if not there already