Conversation with #inferno at Sun Aug 3 00:06:23 2014 on powerman@chat.freenode.net (irc) (00:06:23) #inferno: Topic for #inferno set by mennis at 17:30:16 on 12/28/09 (01:38:13) qrstuv: does anyone have any ideas about how to organize the database for a dns server? (01:38:35) qrstuv: i want to serve records from both my /lib/ndb and from /mnt/registry (01:38:56) qrstuv: one way is to change the registry to serve an ndb file (01:41:23) powerman: qrstuv: I think registry already able to do this (01:41:40) qrstuv: another is to have the dns server mount a control interface on /mnt/dns or somewhere and have an auxiliary process watch the registry and manage the dns control interface (01:42:29) powerman: there are "static services", which are just plain text file /lib/ndb/registry (01:44:35) qrstuv: but the registry won't notice if it has been changed (01:45:29) powerman: but I don't really understand why you wanna use registry data as source for dns records (01:46:02) qrstuv: i want to associate port numbers with symbolic names (01:46:37) powerman: hm. dns doesn't resolve port numbers. or you're talking about cs? (01:47:24) qrstuv: i've already modified cs and the dns client to look up srv records (01:47:30) qrstuv: now i'm doing the server side (01:50:34) powerman: so, you want your services to listen on random ports, register in registry like "host:port srv=port_name", and use this dynamic information to report "port" by "port_name" from your dns server, to allow clients to connect to that service by sending to cs "host:port_name"? (01:51:02) qrstuv: yes (01:52:37) powerman: what's for? why not just search registry for service with "srv=port_name" attr and get "host:port" from service name as result? (01:52:41) qrstuv: another way would be to write a file server that reads /mnt/registry/index and /mnt/registry/event and serves an ndb file (01:52:58) qrstuv: because i want this to work over the internet (01:53:10) qrstuv: with multiple plan 9 sites (01:53:21) powerman: dns isn't really suitable for this, it's not dynamic enough like registry, it doesn't provide events when registered services changed/added/removed, etc. (01:53:41) qrstuv: low ttl's are good enough for what i want (01:54:55) powerman: I suppose if you're using dns instead of registry then service's host names also should be static/hardcoded? (01:55:19) powerman: in this case, why not also hardcode port numbers instead of using random ports? (01:55:49) qrstuv: because i don't want to have to synchronize the port mappings every time i change something (01:56:09) qrstuv: i would have to copy them to every plan 9 site and to every single unix machine (01:56:16) qrstuv: and which map is the master? (01:56:19) qrstuv: who knows (01:57:06) powerman: honestly, I don't see the problem here yet. you can copy /usr/bin/ssh to any unix machine, it uses hardcoded port 22, and everything is fine (01:57:29) powerman: inferno's auth services also use hardcoded port numbers (01:58:09) qrstuv: because these services come and go frequently enough that it's annoying (02:00:26) powerman: if these services are dynamic enough - use registry to find them. but if you wanna hardcode service's host name and port NAME in clients - this doesn't really differ from hardcoding port numbers. or appending your own variant of /lib/ndb/services to /etc/services on each client's machine (02:02:28) qrstuv: the names are not hard coded either (02:03:03) powerman: as for your original question, I think your dns server should use static database from usual place (/lib/ndb/dns?) plus it should implement registry client, and dynamically update dns records in memory accordingly to changes in registry (02:04:19) powerman: "the names are not hard coded either" - you talking about host names? when what you'll ask dns server for? (02:05:07) qrstuv: the service names are made up by a human as the need arises and stay for as long as they're necessary (02:08:05) qrstuv: so i give /net/cs a query like tcp!honestachmed.net!testdb or tcp!honestachmed.net!musicdb (02:09:51) qrstuv: if i wanted clients to query the registry directly, i would have to maintain a connection to each registry or suffer 19 round trips per query (02:10:02) powerman: btw, to manually test my own services with nc (netcat) I've just implement simple wrapper around nc which use it params to query registry and then start nc on host:port fetched from registry (02:10:32) qrstuv: even if i keep active registry connections around, it's 10 round trips (02:12:32) qrstuv: if i keep the fd for registry/find around, it's six round trips per query (02:12:42) qrstuv: but that's a mess to manage (02:12:54) qrstuv: especially on unix clients (02:17:36) powerman: i.e. you need unix clients, which should run, send a couple of requests to "musicdb" and exits, and do that so often what startup delay needed to fetch info from registry isn't acceptable? (02:18:32) powerman: are you sure you ain't premature optimize this? (02:18:52) qrstuv: it's not that it's intolerable; it's just stupid compared to using dns (02:19:25) powerman: hm. I don't think it's stupid. it's just different. (02:19:59) qrstuv: different enough that i would have to write a bunch of otherwise-useless code (02:20:13) powerman: btw, dns also need several round trips per query - depending on how.deep.is.your.domain.com (02:20:59) powerman: and with low ttl it's won't be able to avoid these round trips in usual way - by caching (02:23:00) qrstuv: these things are coming and going at a human's pace and the ttl's can be set proportionally (02:24:52) qrstuv: but the main purpose here isn't to minimize look-up latency, but to get the computers to organize themselves without me having to lift a finger (02:25:16) powerman: btw, how your unix clients will access /net/cs to resolve port names? standard libs won't resolve port names using SRV records AFAIK, so you'll anyway need to write some extra code to get port number - either from dns or from registry (02:26:21) powerman: and I believe is using registry is much better - just because it was designed for this (02:26:37) qrstuv: well dns was also designed for this (02:27:03) qrstuv: for unix hide the dns gunk behind a dial(2)-like function (02:27:10) qrstuv: i'll add the srv gunk to that (02:28:07) qrstuv: well, to the extent that you could call dns designed (02:29:30) powerman: as for round-trips - I've implemented tcp wrapper in limbo for registry, which prove access to new/find/event files in /mnt/registry for anyone who connect to tcp ports 6701,6702,6703 (port per file) (02:30:54) powerman: it was implemented for clients without 9P support, but also solve round-trip issue because it's enough to send and receive 1 packet to find service in registry (well, not counting tcp syn/fin - but you can implement same using udp) (02:33:26) powerman: it was never released, but it's used for years in production - if you want I can copy source to pastebin (02:33:47) qrstuv: 9paste.net pls (02:34:18) powerman: http://www.9paste.net/none/364-354-5903 (02:34:51) qrstuv: and also /n/fs.9paste.net/none/364-354-5903 (02:35:53) powerman: here is sh script I use to run registry service (both using 9P and this tcp wrapper): http://www.9paste.net/none/535-972-4476 (02:46:21) bbarker [uid33544@gateway/web/irccloud.com/x-mzowjkkipyqjjayo] entered the room. (04:50:06) qrstuv: i've decided against having a /mnt/dns that an auxiliary process writes the data from the registry to, since if the auxiliary process crashes or something, the restarted process won't know what state /mnt/dns is supposed to be in (04:55:13) qrstuv: and also if i turn the registry data into an ndb file, i can use the existing ndb tools on it (07:57:39) xspager [~dlemos@187.67.93.229] entered the room. (08:17:22) bjorkintosh left the room (quit: Ping timeout: 255 seconds). (08:27:47) bjorkintosh [~bjork@ip68-13-229-200.ok.ok.cox.net] entered the room. (08:39:19) xspager left the room (quit: Quit: This computer has gone to sleep). (08:40:45) xspager [~dlemos@187.67.93.229] entered the room. (08:50:36) xspager left the room (quit: Quit: This computer has gone to sleep). (11:18:27) bbarker left the room (quit: Quit: Connection closed for inactivity). (16:06:31) Fish- left the room (quit: Quit: WeeChat 0.4.3). (17:48:36) Fish- [~Fish@APuteaux-653-1-52-41.w86-195.abo.wanadoo.fr] entered the room. (19:16:34) Fish- left the room (quit: Ping timeout: 240 seconds). (19:30:27) Fish- [~Fish@APuteaux-653-1-232-87.w86-195.abo.wanadoo.fr] entered the room. (19:44:04) doublec left the room (quit: Remote host closed the connection). (19:44:31) doublec [~doublec@gateway/tor-sasl/doublec] entered the room. (01:52:54) shazaum [~shazaum@177.184.130.30] entered the room. (01:52:55) shazaum left the room (quit: Changing host). (01:52:55) shazaum [~shazaum@unaffiliated/shazaum] entered the room. (02:41:29) shazaum left the room (quit: Quit: This computer has gone to sleep). (03:11:04) shazaum [~shazaum@unaffiliated/shazaum] entered the room. (05:16:16) shazaum left the room (quit: Quit: Saindo). (06:28:13) qrstuv: it seems like if you create an iob with Iobuf.sopen or .aopen, and then read to eof, bufio will throw the data away and you won't be able to seek back to the beginning (06:28:37) qrstuv: so if you create an Attrdb->Db with Db.sopen, you can only search through it once (06:28:50) qrstuv: and all look-ups afterwards will fail (10:09:51) rogpeppe [~rog@host-92-23-133-217.as13285.net] entered the room. (13:25:05) baux [~baux@out-pix.zucchetti.com] entered the room. (15:12:14) qrstuv1 [bootes@50.103.224.54] entered the room. (15:19:04) qrstuv left the room (quit: *.net *.split). (16:31:23) rogpeppe left the room (quit: Ping timeout: 240 seconds). (16:31:33) rogpeppe [~rog@host-92-23-133-217.as13285.net] entered the room. (21:00:42) baux left the room (quit: Remote host closed the connection). (22:12:11) pfallenop left the room (quit: Ping timeout: 256 seconds). (22:14:50) pfallenop [~pfallenop@95.141.35.235] entered the room. (22:15:00) pfallenop left the room (quit: Changing host). (22:15:01) pfallenop [~pfallenop@unaffiliated/contempt] entered the room. (22:23:23) pfallenop left the room (quit: Ping timeout: 240 seconds). (22:27:41) pfallenop [~pfallenop@unaffiliated/contempt] entered the room. (00:16:11) qrstuv1 is now known as qrstuv (00:54:16) shazaum [~shazaum@unaffiliated/shazaum] entered the room. (02:17:50) shazaum left the room (quit: Quit: This computer has gone to sleep). (02:46:27) bjorkintosh left the room (quit: Ping timeout: 256 seconds). (02:50:53) bjorkintosh [~bjork@ip68-13-229-200.ok.ok.cox.net] entered the room. (03:20:31) Fish left the room (quit: Ping timeout: 244 seconds). (03:21:41) Fish [~Fish@89-93-66-105.hfc.dyn.abo.bbox.fr] entered the room. (04:23:14) shazaum [~shazaum@unaffiliated/shazaum] entered the room. (04:30:44) cneira [~cneira@pc-228-196-44-190.cm.vtr.net] entered the room. (05:20:40) cneira left the room (quit: Ping timeout: 250 seconds). (05:49:34) Fish left the room (quit: Ping timeout: 240 seconds). (05:52:40) Fish [~Fish@89-93-66-105.hfc.dyn.abo.bbox.fr] entered the room. (05:56:13) shazaum left the room (quit: Quit: This computer has gone to sleep). (05:57:39) rogpeppe1 [~rog@host-92-23-133-217.as13285.net] entered the room. (05:57:44) rogpeppe left the room (quit: Ping timeout: 255 seconds). (06:22:04) Fish left the room (quit: Ping timeout: 240 seconds). (06:23:30) Fish [~Fish@89-93-66-105.hfc.dyn.abo.bbox.fr] entered the room. (09:07:39) Gegemon [~ynv@mx1.airis.ru] entered the room. (13:16:18) baux [~baux@out-pix.zucchetti.com] entered the room. (16:14:35) leetspete left the room (quit: *.net *.split). (16:14:35) PaulHarris left the room (quit: *.net *.split). (16:15:38) leetspete [~pete@cpe-104-33-95-25.socal.res.rr.com] entered the room. (16:15:39) PaulHarris [~smoothop@narbondel.org] entered the room. (17:00:17) cneira [~cneira@pc-228-196-44-190.cm.vtr.net] entered the room. (17:37:46) cneira left the room (quit: Ping timeout: 250 seconds). (18:49:09) baux left the room (quit: Remote host closed the connection). (18:51:24) baux [~baux@out-pix.zucchetti.com] entered the room. (21:00:14) baux left the room (quit: Remote host closed the connection). (21:08:40) doublec left the room (quit: Ping timeout: 264 seconds). (21:10:25) doublec [~doublec@gateway/tor-sasl/doublec] entered the room. (22:04:43) yiyus left the room (quit: Ping timeout: 256 seconds). (22:10:00) yiyus [1242712427@je.je.je] entered the room. (01:00:11) shazaum [~shazaum@177.184.130.30] entered the room. (01:00:19) shazaum left the room (quit: Changing host). (01:00:19) shazaum [~shazaum@unaffiliated/shazaum] entered the room. (01:13:32) _sl left the room (quit: Ping timeout: 245 seconds). (01:40:56) shazaum left the room (quit: Quit: Saindo). (02:22:41) cneira [~cneira@pc-228-196-44-190.cm.vtr.net] entered the room. (02:23:47) cneira left the room (quit: Read error: Connection reset by peer). (09:53:02) baux [~baux@out-pix.zucchetti.com] entered the room. (10:58:54) Gegemon left the room (quit: Ping timeout: 264 seconds). (10:59:26) bjorkintosh left the room (quit: Ping timeout: 265 seconds). (10:59:34) Gegemon [~ynv@mx1.airis.ru] entered the room. (11:00:27) bjorkintosh [~bjork@ip68-13-229-200.ok.ok.cox.net] entered the room. (11:53:26) Gegemon left the room (quit: Ping timeout: 266 seconds). (11:54:28) Gegemon [~ynv@mx1.airis.ru] entered the room. (16:56:05) Gegemon left the room (quit: Quit: Leaving.). (19:16:41) baux left the room (quit: Remote host closed the connection). (20:39:22) _sl [~sl@gl.inri.net] entered the room. (20:44:13) qrstuv left the room (quit: Quit: jmk added reentrancy for threads). (05:22:21) qrstuv [bootes@50.103.224.54] entered the room. (07:30:50) devn_ [~devn@rot13.pbqr.org] entered the room. (07:35:33) qrstuv left the room (quit: *.net *.split). (07:35:34) yshurik left the room (quit: *.net *.split). (07:35:35) leetspete1 left the room (quit: *.net *.split). (07:35:36) devn left the room (quit: *.net *.split). (07:42:26) qrstuv [bootes@50.103.224.54] entered the room. (07:44:25) yshurik [~yshurik@62.92.189.109.customer.cdi.no] entered the room. (08:05:58) The account has disconnected and you are no longer in this chat. You will automatically rejoin the chat when the account reconnects.