Closed (works as designed)
Project:
Provision
Version:
6.x-0.3-rc2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
11 Aug 2009 at 10:01 UTC
Updated:
18 Dec 2009 at 16:45 UTC
Jump to comment: Most recent
Comments
Comment #1
Anonymous (not verified) commentedBeen reproducing this from the get-go :) Subscribing!
Comment #2
adrian commentedThe issue is the limited amount of characters available for database and user names.
we use site_id to generate the db name where available to avoid possible naming clashes.
you can only have so many wwwmydomain databases before you start treading on other site's namespaces.
also keep in mind that the db name changes over the lifetime of the site.
ie: site_123 becomes site_123_0 after the first migration etc.
To be non destructive we need to do the site_id naming convention.
Comment #3
Anonymous (not verified) commentedI wouldn't have thought there'd ever be a case of two databases both wwwexamplecom, if the URL is the same, the Site form wouldn't have validated surely :) so I wonder if it'd ever clash?
Thanks for the info though, I didn't know a migration causes a 'revision' increment of the db name (or that a new database was even created). Good to know.
Comment #4
anarcat commentedThe issue here is that the database names need to be trimmed to (iirc) 16 characters. So while it is unlikely, it's possible to have a clash between two database names, let's say, drupal-4.7.test.site.example.com and drupal-4.7.test.site.example.org. Those would both resolve to something like drupal47testsitee as a database name.
Basically, this works well for small domain names that do not clash, but it's a recipe for disaster for large sites with lots of domains. Also, it can get very confusing if user A creates www.example.com.evil.com and then user B creates www.example.com. The first database name is going to be wwwexamplecomevi and the second one will be wwwexamplecom. It could be very easy for an operator to confuse the two, and that's an example where the domain name has less than 16 chars. If a domain name has exactly the same number of chars, that attack is even more effective.
So my vote goes to keeping the current scheme. It scales up to 2147483647 sites (or at least 2147483647 nodes on the frontend) which should be plenty for starters (famous last words).
I'm not sure the other naming convention would scale as well. Plus now we get a prefix that distinguishes aegir tables from other tables on a shared database server...
Comment #5
Anonymous (not verified) commentedYep, I didn't take into consideration the 16 character limit, potential for clashes there absolutely. And the confusion layer too. No problems for this to stay per design, +1 vote for node-id db names definitely :)
Comment #6
eaton commentedGiven that the database is only created once, would it be possible to do something as simple as check for $node->custom_db_name during the initial setup process, and use the nid-based system if none is set? Allow other Hostmaster/Aegir plugin modules to implement custom naming conventions?
I understand the need for nids as the default naming scheme, but there are quite a few situations where alternate approaches would cause no problems, and would give a big boost to usefulness for devs coming up to speed on how Aegir works. Thoughts? Objections? Torches and pitchforks?
Comment #7
adrian commentedYou can pass --db_name to the script to specify the db name, so you can easily implement another naming convention.