On Friday, May 6, 2016 at 2:21:09 PM UTC-7, Jeremy Evans wrote: > > One long standing issue with Sequel's sharding support is that Sequel does > not log which shard is used. I've considered changing this for a while, > but it requires adding 1-2 new logging methods and modifying all adapters > that ship with Sequel to use them. There would also be a slight > performance hit when logging even for people not using sharding. > > I'm on the fence about whether changing the logging to log the shard used > is worth it. If you have strong feelings one way or the other, please post > here and explain whether you are for or against this change. >
After giving some more thought to this, I realized this is a problem even in the unsharded case, as long as you are using the default threaded connection pool. From looking at the logs, you don't know which connection issued which queries, which in certain cases is important information. I've added the ability to include the connection info when logging. This required modifying all adapters that ship with Sequel to use a new logging method. The logging of connection info is off by default, but you can turn it on via: DB.log_connection_info = true After this change was made, it was trivial to include the shard information in the logs via a database extension, just by keeping a map of connections to shards. So I've added that as well. Thanks, Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/sequel-talk. For more options, visit https://groups.google.com/d/optout.
