6.0.0-beta1
7/4/25

[#9467] horde_vfs with splitread MySQL
Summary horde_vfs with splitread MySQL
Queue Horde Groupware Webmail Edition
Queue Version 1.2.6
Type Bug
State Resolved
Priority 2. Medium
Owners jan (at) horde (dot) org
Requester roderburg (at) uni-koeln (dot) de
Created 12/23/2010 (5307 days ago)
Due
Updated 01/12/2011 (5287 days ago)
Assigned 12/28/2010 (5302 days ago)
Resolved 01/12/2011 (5287 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
01/12/2011 11:32:03 AM Git Commit Comment #7 Reply to this comment
Changes have been made in Git for this ticket:

Fix splitread database usage in VFS (Bug #9467).

http://git.horde.org/horde-git/-/commit/76b6725d97341196296ca077d9773ca5ed4a8e45
01/12/2011 10:57:02 AM Jan Schneider Comment #6
Assigned to Jan Schneider
State ⇒ Resolved
Reply to this comment
Good catch, thanks.
01/12/2011 09:27:19 AM roderburg (at) uni-koeln (dot) de Comment #4
New Attachment: vfs-sql.patch Download
Reply to this comment
The failing requests are definitively sent to the Read DB.
So I think, there must be places, where this "write object" is *not* 
used for writing.
With a lot of debugging I have finally found the place where this 
happens. It is in the VFS function CreateFolder in lib/VFS/sql.php. 
And after I knew what to look for I found one more occurence of the 
same error in the VFS function DeleteFile.

Patch attached.

12/29/2010 08:51:26 AM roderburg (at) uni-koeln (dot) de Comment #3 Reply to this comment
The code may look fine, but unfortunately it does not work fine.
The failing requests are definitively sent to the Read DB.
So I think, there must be places, where this "write object" is *not* 
used for writing.
Perhaps an expert can get some clue from the Log-File-Snippet in my 
bug report.
Btw, would lib/VFS/sql.php be the right module to look, given my 
configuration?

12/28/2010 07:29:42 PM Jan Schneider Comment #2
State ⇒ Feedback
Reply to this comment
The code looks fine, the splitread information is passed to the 
driver, the driver instantiates two different database objects, and it 
uses the write object for the INSERT query. You have to track down 
yourself why the insert fails.
12/23/2010 11:40:13 AM roderburg (at) uni-koeln (dot) de Comment #1
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ horde_vfs with splitread MySQL
Queue ⇒ Horde Groupware Webmail Edition
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
We have activated the MySQL splitread feature in our Horde installation.

Relevant config parameters:

$conf['sql']['persistent'] = true;
$conf['sql']['username'] = 'horde';
$conf['sql']['password'] = '*******';
$conf['sql']['hostspec'] = 'mysqlgold.rrz.uni-koeln.de';
$conf['sql']['port'] = 3306;
$conf['sql']['protocol'] = 'tcp';
$conf['sql']['database'] = 'horde3';
$conf['sql']['charset'] = 'utf-8';
$conf['sql']['ssl'] = false;
$conf['sql']['read']['persistent'] = true;
$conf['sql']['read']['username'] = 'horde';
$conf['sql']['read']['password'] = '*******';
$conf['sql']['read']['hostspec'] = 'modulok.rrz.uni-koeln.de';
$conf['sql']['read']['port'] = 3306;
$conf['sql']['read']['protocol'] = 'tcp';
$conf['sql']['read']['database'] = 'horde3';
$conf['sql']['read']['charset'] = 'utf-8';
$conf['sql']['splitread'] = true;
$conf['sql']['phptype'] = 'mysql';

mysqlgold is the MySQL master, modulok the read-only MySql Slave.

$conf['prefs']['driver'] = 'sql';
$conf['alarms']['driver'] = 'sql';
$conf['datatree']['driver'] = 'sql';
$conf['group']['driver'] = 'sql';
$conf['perms']['driver'] = 'sql';
$conf['share']['driver'] = 'sql';
$conf['lock']['driver'] = 'sql';
$conf['token']['driver'] = 'sql';

All of these work as expected.

$conf['vfs']['type'] = 'sql';
$conf['vfs']['params']['driverconfig'] = 'horde';

The vfs system, however, has problems.
When it tries to write something into the DB, we get error messages 
like this in the imp log and the user gets a "DB Error: unknown error"

Dec 22 14:52:55 HORDE [error] [imp] DB Error: unknown error: INSERT 
INTO horde_vfs (vfs_id, vfs_type, vf _path, vfs_name, vfs_modified, 
vfs_owner) VALUES (1096, 2, '.horde/imp/attachments', 'nzaremeh', 
1293025 75, '') [nativecode=1290 ** The MySQL server is running with 
the --read-only option so it cannot execute this statement] [pid 1310 
on line 2678 of 
"/var/local/ukweb/webmail/docs/horde-3.3/imp/lib/Compose.php"]

which seem to indicate that the correct writeable MySQL host is not used.

Main place where this happens when "linked attachments" are used.

Saved Queries