fix(linux_dns_issue): Re-trying DNS lookup of instance name after appending the domain from AG listener - #57
Conversation
Ryan Clare (Kaneraz)
left a comment
There was a problem hiding this comment.
Some odd spacing showing up in the diff, but it looks like it's doing what we set out to do.
instance before using dns function when on linux platform
Alex Irion (alexirion10)
left a comment
There was a problem hiding this comment.
Code looks ok... but this is tricky.
I'm not certain that instanceName.Contains('.') means that it's a FQDN necessarily
Did you test? How did you test? Can you provide some sample I/O?
|
I'm not sure if there is another way to check? I thought that if it has at least one i.e. if |
|
Exactly... |
… 'agReplicaInstanceName' is already FQDN
|
Alex Irion (@alexirion10) checked where this function is being called from and it looks like the only values being passed in are the replica instance names - which won't be FQDN Also renamed a few variables as I am understanding the terminologies and tech stack a little better now 😄 What do you think? |
|
Aditya Niraula (@AdityaNPL) if we're concerned about getting the FQDN instead of just a hostname we can attempt to resolve the hostname first and if it fails, then attempt to append from the original listener name. |
|
Changing this to Draft as I think this needs much more refactoring before it is ready to release publicly. Sure Ryan Clare (@Kaneraz) , yes I think changing to a try-catch might be less error prone for us right now - will change to that |
…rt()' + PR suggestions
|
Have refactored and added tests for the utility functions - I think should be ready for release |
Alex Irion (alexirion10)
left a comment
There was a problem hiding this comment.
I mean... I'm sure it works, but man this code is messy and fragile. I'm nervous with the amount of string parsing happening in here
|
The code logic of our fix:
Alex Irion (@alexirion10) I agree, but looking above at the steps we need to do, I think the string manipulations are required. I have some suggestions that could give us more confidence:
What are your thoughts? |
Ryan Clare (Kaneraz)
left a comment
There was a problem hiding this comment.
As we've discussed this is a bit of a tangle, but after looking at it a few time I'm not seeing a clear way to untangle it. Once we get things in place to resolve WINS on the containers this runs in, we can consider removing the hack.
Thanks for the unit tests, they give me confidence that this is going to remain stable as we keep moving forward and balances out my concerns with how tangled it feels.
Dns.GetHostEntry(instance)fails intermittently on linux platforms ifinstancedoesn't have the full domain