[GENIUS-98] InetAddress should not be used to get a unique bladeId Created: 06/Nov/17 Updated: 28/Aug/19 |
|
| Status: | Open |
| Project: | genius |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Medium |
| Reporter: | Michael Vorburger | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
genius currently uses a line roughtly similar to this: int bladeId = InetAddresses.coerceToInteger(InetAddress.getLocalHost()); in at least 3 places (fcapsapp/NodeEventListener, ResourceManagerUtils, IdUtils & new LockManagerUtils in c/61526) but I believe this is not a good idea, because: A. if you ran x2 ODL instances next to each other on a host, for local or Cluster testing in some CI, or even in production in theory, then you would have the same bladeId... I do understand that in production the more typical deployment would be completely separate VMs (and jluhrsen says that's what clustered CSIT does as well), or containers. But it's still not great that we've basically hard-coded, in several places, that you HAVE to run them separated? Even though there would be port conflicts and what not... still not great, IMHO. B. InetAddress.getLocalHost() is known to have issues sometimes, see e.g. Ideally, we should use another unique "bladeId" - I'm assuming that this really is trying to be is a unique ID of a node instance in a cluster, is it? If that's the case, then there must another more reliable and safer way to obtain something like that? Some controller API, perhaps? Something else native in the JVM, like.. its PID? Or some... random number?? |
| Comments |
| Comment by Kency Kurian [ 07/Nov/17 ] |
|
Michael, As you have mentioned the idea of bladeId is to uniquely identify each node in a cluster. I would suggest to use something which will be consistent across controller restarts. |
| Comment by Hema Gopalakrishnan [ 28/Aug/19 ] |
|
Closing this bug as its an old one |