-
Notifications
You must be signed in to change notification settings - Fork 18
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
Nodes left in DB with profileNum:null #39
Comments
For reference, this should delete the original issue items:
I was having a similar problem with my slot 5, so dump shows this:
So when I try to add a new nodeserver in this slot it makes the controller use this data instead of what my nodeserver tells it... So I ran this.
Isn't that run when you delete a nodeserver from a slot?? I had looked at all nodes using robo3t and for some reason I didn't see those nodes but it could be my lack of knowledge about mongodb... That's why I did the dump and grep... |
This causes a lot of pain, just had another user with a corrupt slot. He deleted this nodeserver but all this old data is still there...
|
I believe I have a fix for this. When updateNode is called, it simply checks if the node exist by doing a query for one by address. If it find one of these records with the null profile number, it just uses it. My fix is to also check for a valid profile number, if it's null, then treat it as if the node record doesn't exist. That seems to make everything happy again. |
That sounds good! Also, seems like polyglot should do a sanity check on the db once in an while and cleanup these bad null entries or entries for a profile that is deleted? |
@bpaauwe & @Einstein42 Have you made this change? Can we please get it released :) It keeps causing pain. |
Good question, that was months ago. I'll have to check if that was part of the PR I submitted back on Nov. 8th |
Looks like it's on the edev branch. Handle null profile number in updateNode. cf2949f |
When updateNode is called, it first checks to see if there is a node in the database by address. If it finds one, it attempts to update it. However, it is possible to have the node in the database but have the profileNum field be null. This causes Polyglot to get into a state where it thinks everything is up-to-date, but in reality, the node doesn't really exist. This is really bad if it's the controller node for the node server. The fix is fairly simple. If the node exist in the database, check to see if the profile number is null. If it is, treat it the same as if the node doesn't exist. Polyglot will then go through the steps to create the node and put everyting into a "normal" state.
Thanks! I've pinged everyone on slack to see what we can do. |
No idea how these got there, but this was from a user after deleting the nodeserver in slot 1.
The text was updated successfully, but these errors were encountered: