[SERVER-31570] Adjust mongobridge port allocations for easier debugging Created: 13/Oct/17 Updated: 30/Oct/23 Resolved: 02/Oct/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.9, 4.0.4, 4.1.4 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Max Hirschhorn |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | tig-qwin-eligible | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||
| Backport Requested: |
v4.0, v3.6
|
||||||||||||
| Sprint: | STM 2018-10-08 | ||||||||||||
| Participants: | |||||||||||||
| Linked BF Score: | 0 | ||||||||||||
| Story Points: | 3 | ||||||||||||
| Description |
|
Mongobridge assigns ports sequentially so you have to use modular arithmetic to figure out which bridges are associated with which mongods. If we assigned (bridge port) = (mongod port) + 10000, it would be very easy to map them to each other. |
| Comments |
| Comment by Githook User [ 20/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: Also introduces a resetAllocatedPorts() function so that tests which (cherry picked from commit 60c9cbf7b6ab033930003c0ef434d64136bddd02) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 20/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: Also introduces a resetAllocatedPorts() function so that tests which (cherry picked from commit 60c9cbf7b6ab033930003c0ef434d64136bddd02) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 02/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Max Hirschhorn [ 02/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Reopening to add the necessary tags to the shell_mongobridge_port_allocation.js test. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 01/Oct/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Max Hirschhorn', 'email': 'max.hirschhorn@mongodb.com', 'username': 'visemet'}Message: Also introduces a resetAllocatedPorts() function so that tests which | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by William Schultz (Inactive) [ 27/Jul/18 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
max.hirschhorn Is this a probable work item for the near future? I also think it would be very nice to have. I personally feel that examining mongobridge'd nodes in >3 node replica sets is a recurring, moderate source of debugging pain. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Judah Schvimer [ 13/Oct/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
100 seems fine, since all that really matters is that they end in the same last two digits. That's a clever solution to ensure we don't double allocate. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Max Hirschhorn [ 13/Oct/17 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
judah.schvimer, I don't think we could do +10000 because the mongo shell only receives 240 contiguous ports to use in order to leave room in the ephemeral port range for running resmoke.py with large numbers of --jobs. Since ReplSetTest does its port assignment eagerly (rather than delegating to MongoRunner.runMongod()), I think we could preallocate 100 ports (or whatever we want the offset between mongobridge's --port and mongod's --port to be) and the hand them out depending on which kind of process ReplSetTest is attempting to spawn.
Edit: The approach in this patch probably won't work for cases where ShardingTest is starting a replica set shard and using mongobridge because we'll run out of ports that can be used by preallocating so many of them. |