You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's similar to what was mentioned in #2979 but my use case is a bit different. I'm trying to have the connection pool in rethinkdbdash automatically populates connections to all the servers listed in the table server_status.
And one problem that surfaces is that people may try to populate the pool from localhost. I have one pool per server (and a "master" that manage all these pools). Since localhost will match all the servers, I can't know exactly in which pool I should put these connections.
I'm working around this by opening new connection to not localhost (by picking up the "wider" address and closing the one to localhost, but being able to run r.whoami() and get a server id would make the code way more simple.
If the server id can be returned at the end of the handshake, that would also work for me.
Also, it's not a query. So if you run >>> conn.server_id() in the Python console, it just returns the UUID as a string. You don't write conn.server_id().run(conn) or anything like that.
Activity
deontologician commentedon Mar 18, 2015
+1 this is the last special /ajax functionality the webui is using (beyond the http reql connections)
mlucy commentedon Mar 18, 2015
@danielmewes -- putting this in 2.1 so it's in a milestone and we don't forget about it, but feel free to move it out if there isn't room.
danielmewes commentedon Mar 18, 2015
There was some relevant discussion about this in #2979
We should consider exposing this functionality as a function on the connection object instead of a ReQL term I think, like discussed over there.
timmaxw commentedon Apr 21, 2015
Yeah, I definitely think this should be a method or variable on the connection rather than a ReQL term.
danielmewes commentedon Apr 21, 2015
To bring something else over from the other thread: I really prefer the name
conn.server_uuid()overconn.whoami().timmaxw commentedon Apr 21, 2015
I think
server_idis better, for consistency with the system tables.danielmewes commentedon Apr 21, 2015
Sure,
server_idsounds good.coffeemug commentedon Apr 21, 2015
👍 for
conn.server_id()deontologician commentedon Apr 22, 2015
to clarify, will this return the uuid of the server, the server name, or the hostname of the server?
timmaxw commentedon Apr 22, 2015
This will return the UUID of the server as a string.
timmaxw commentedon Apr 22, 2015
Also, it's not a query. So if you run
>>> conn.server_id()in the Python console, it just returns the UUID as a string. You don't writeconn.server_id().run(conn)or anything like that.deontologician commentedon Apr 22, 2015
It'd be super super nice if I could get the server name as well without having to query server_config
mlucy commentedon Apr 22, 2015
What if we had
conn.server()and it returned{name: X, id: Y}?9 remaining items
danielmewes commentedon Apr 28, 2015
Marking settled with
conn.server_id(), orconn.server()if it's similarly easy to implement.mglukhovsky commentedon Aug 3, 2015
This would be really useful for the web UI, and for
rethinkdb import(see #4617).dancannon commentedon Aug 3, 2015
Would also be really useful for gorethink, currently the way I am checking host status is a bit hacky.
encryptio commentedon Nov 9, 2015
in review with @VeXocide, CR 3317
dancannon commentedon Nov 9, 2015
This is great, Thanks for the work guys!
encryptio commentedon Nov 10, 2015
Done in
next, will be in 2.2.implement conn.server()