I just started to learn source code of rlm_sqlippool.c to make changes for my issue. (I want to make sensitive return code from sqlippool_command and check it in sqlippool_postauth and if something goes wrong, then at once try to allocate next sql connection from the pool until I'll get an error "cannot allocate sql connection" (if one sql server is down) and return code RLM_MODULE_FAIL.)<br /> I'm not C guru, but there is a strange things in the code of this module.<br /><br />Let's look at the function "sqlippool_postauth". There is an allocation of the socket in the begining (string 571), but release only at the end (string 652). What will happans, if this procedure will return value untill this string? For example, when IP address could not be allocated? (string 648) Does it mean, that this module will "freez" pool connection and this may be a course of the unavailability of all sql connections?<br /><br /><br /> <br /> <div class="noTransl">Quoting <strong>Konstantin Chekushin <<a href="mailto:koch2@inbox.lv">koch2@inbox.lv</a>></strong>:</div> <blockquote style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi! I have a question about failover configuration.<br /> <br /> I have freeradius + sqlippool module for ip-assigning. I have 2 databases for redundancy (described in sql1 and sql2).<br /> <br /> my file from enabled-server:<br /> <br /> server allauth {<br />         listen {<br />                 type = auth<br />                 ipaddr = *<br />                 port = 1812<br />         }<br />         authorize {<br />                 auth_log<br />                 update control {<br />                         Pool-Name = 'main_pool'<br />                 }<br />                 redundant {<br />                         # we need this only to get new Pool-name, if user exist in our defined group.<br />                         sql1<br />                         sql2<br />                 }<br />                 update control {<br />                         # any user must be accepted.<br />                         Auth-Type = 'Accept'<br />                 }<br />         }<br />         post-auth {<br />                 redundant {<br />                         sqlippool1 # this module use sql1 for assigning<br />                         sqlippool2 # this module use sql2 for assigning, if first will fails.<br />                         main_pool<br />                 }<br />                 reply_log<br />         }<br /> }<br /> <br /> I've run the freeradius, but when I turned off my first database (sql1), my redundancy in post-auth return incorrect code:, sqlippool1 returns "noop", neither "fail".<br /> May be I've selected the wrong way to solve my task? Any comments are welcome... How can I switch ip-assigning on sqlippool2, when sql1 (used by sqlippool1) doesn't work?<br /> <br /> some information from log:<br /> <br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql (sql1): Failed to connect DB handle #1<br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql (sql1): reconnect failed, database down?<br /> Wed Feb  3 15:36:29 2010 : Error: sqlippool_command: database query error in: 'COMMIT'<br /> Wed Feb  3 15:36:29 2010 : Info: [sqlippool1]   expand: SELECT id FROM radippool  WHERE pool_name='%{control:Pool-Name}' LIMIT 1 -> SELECT id FROM radippool  WHERE pool_name='main_pool' LIMIT 1<br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql_mysql: Socket not connected<br /> Wed Feb  3 15:36:29 2010 : Debug: rlm_sql (sql1): Attempting to connect rlm_sql_mysql #1<br /> Wed Feb  3 15:36:29 2010 : Info: rlm_sql_mysql: Starting connect to MySQL server for #1<br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql_mysql: Couldn't connect socket to MySQL server user@ip:dbname<br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql_mysql: Mysql error 'Lost connection to MySQL server at 'reading initial communication packet', system error: 0'<br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql (sql1): Failed to connect DB handle #1<br /> Wed Feb  3 15:36:29 2010 : Error: rlm_sql (sql1): reconnect failed, database down?<br /> Wed Feb  3 15:36:29 2010 : Error: sqlippool_query1: database query error<br /> Wed Feb  3 15:36:29 2010 : Debug: rlm_sql (sql1): Released sql socket id: 1<br /> Wed Feb  3 15:36:29 2010 : Info: [sqlippool1] IP address could not be allocated as no pool exists with that name.<br /> Wed Feb  3 15:36:29 2010 : Info: +++[sqlippool1] returns noop<br /> Wed Feb  3 15:36:29 2010 : Info: ++- policy redundant returns noop </blockquote>