Bug #7588 HSS: Bug in RSEHSS_ApiCopy
Submitted: 30 Dec 2004 11:37 Modified: 18 Jul 2005 11:20
Reporter: Alexander Opitz Email Updates:
Status: Closed Impact on me:
None 
Category:MaxDB Severity:S3 (Non-critical)
Version:7.5.00.18 and newer OS:Linux (Linux)
Assigned to: Ulf Wendel CPU Architecture:Any

[30 Dec 2004 11:37] Alexander Opitz
Description:
Hi,

as I mention this bug already in the maxdb Mailinglist, I will only copy the text from the mails.

1st mail:

>I'm at the point that I will bring master back to online state "db_online".
>I've now following error in krnldiag.err (shorteniced):
>ERR 13900 RTEHSS RTEHSS_API [ValidateOrCreateSharcannot stat volume directory
>symlink /database/testdb1/wrk/XBDB...]
>
>First the 3 point are some stupid chars, seem to have problems with a pointer.
>RTEHSS_ApiCopy.c line 1793 ... it seems the one % should be %s to resolve this.

2nd mail:

>I've for both an answer, and it would bi nice if someone can fix this bug.
>In RTEHSS_ApiCopy line 1778 you make a "readlink(path, buf, bufsize)"
>
>readlink does not append a NUL character to the buffer, but it returns the
>number of characters wrote to buffer.
>
>That's why sharePath have some bad chars on the end of the name.
>And Line 1793 also need the missing s after second %.

I can provide a patch.

How to repeat:
Try to bring master online on a Linux(unix) System after hss_enable.

Suggested fix:
See second mail.
[6 Jan 2005 11:13] Ulf Wendel
Hi Alex,

thank you for your bug report. Are you referring to http://lists.mysql.com/maxdb/23894 ?

I've had a look at the code and I agree with you. The source contains some flaws. 

sharePath is an uninitialized local variable. readlink() does terminate it with \0 and this might cause some trouble in ReportError(). ReportError() does not map directly to printf(), so I can't say if we need to add a memset() or can use %.*s. I've asked the developers for help.

I'll keep you informed.

Regards,
Ulf
[6 Jan 2005 14:00] Ulf Wendel
Hi Alex,

the developers have created a work entry without any comments. You can track the progress of the work on http://sapdb.org/webpts (Advanced Search => Number => 1133270) once the online database has been synchronized with the internal system.

I'm sorry, I can't provide you with a custom build based on a fixed source code version. If you have any problems building MaxDB from source, please feel free to ask your questions on the public mailinglist or send us a bug report if you spy a bug.

Regards,
Ulf
[6 Jan 2005 14:59] Alexander Opitz
The readlink does NOT add a NUL to the end. 
 
read the man pages like http://www.rt.com/man/readlink.2.html 
 
So you need to get the returned int and set the \0 self or initialise the sharedPath 
with a memset of \0 chars (memset would be slower but it isn't a every time used 
function so may be more secure and stable). You also need to differ if symlink was 
longer then buffer. 
 
I get it compile (more or less, I don't know how to make installable packages, 
complete.mak stops somewhere). 
 
Now I can do hss_addstandby ... this copies also the configurte files but it misses 
LOG001 ... and if I do db_standby it copies more data but then misses LOG001 and 
DAT001. I don't know how the directories must be mapped on both computers and 
how the LOG001 should be shared. But I didn't get answers to my mails how the 
directory structure should look like.
[7 Jan 2005 10:59] Ulf Wendel
Hello Alex,

> The readlink does NOT add a NUL to the end. 

ACK. It've forgotten that little word NOT in my second last last answer. But as you can see from my comment (memset()/ printf() with %.*s), this was a typo. 

> DAT001. I don't know how the directories must be mapped on both computers and 
> how the LOG001 should be shared. But I didn't get answers to my mails how the 
> directory structure should look like.

I know that the HSS documentation is very short. Further documentation is on our TODO, we're evaluating setups, that do not require expensive hardware. 

Please understand that bugs.mysql.com is on bugs only. I can't give you support or consulting on this place. 

The mailinglist is public. Like every mailinglist it's intended for users-helping-users. You should not blame a mailinglist if there's little help for an advanced topic like Hot Standby. Some of the SAP developers participate to the ML, but they do this during their breaks, in their free time.

Regards,
Ulf
[18 Jul 2005 11:20] Ulf Wendel
7.6.00.04  	Delivered  	7.6.00.07  	   	
	

Created
	

Processed
	

Completed
	

Affected OS
	
	2005-01-06 	2005-01-07 	2005-01-07 	All