Mailing List Archive

Problems with drbd Perl Script
Hello together,

i'm currently running drbd 0.5.8.

i stepped over some problems with the perl-script drbd
(cvs revision 1.5)

When i say yes to the question

Do you want to abort waiting for other server and make this one primary?

i get some errors.

First, there seems to be a problem with the parameters of the function
increase_h_count, i think this should probably be this way:

--- ./drbd Fri May 25 11:53:50 2001
+++ /etc/rc.d/init.d/drbd Sat May 26 13:45:41 2001
@@ -384,10 +384,12 @@
$pid = wait();
if($pid == $user) {
my $res;
-
- kill 'INT',keys %syncers;
+
+ kill 'INT',keys(%syncers);
+ print "KILL RETURNED: $!\n";
+
foreach $res (keys %syncers) {
- increase_h_count($res,$conf{$res});
+ increase_h_count(%syncers->{$res},$conf{%syncers->{$res}});
}
last;


The second problem is the kill, which doesn't seem to succeed. I always
get an Illegal Seek (ESPIPE). Probalby because of the backticks within
wait_ready (around line 204). I'm not a perl guru, so i might be wrong.


I'm also not sure about increase_h_count, it first makes the node the
primary and immediately after it makes it the secondary ???


--
Mit freundlichem Gruß

Thomas Stinner - billiton internet services GmbH
Geschäftsleitung
--------------------------------------------------------------
direct phone: 0271/30386-11 direct mail: t.stinner@example.com
Weitere Informationen finden Sie unter http://www.billiton.de/
Re: Problems with drbd Perl Script [ In reply to ]
Hi Thomas,

Of course you are right, I applied your patch in slightly
modified form.

increase_h_count uses the "--human" option, which indicates to the
meta data management that this decission (to become primary) was
made by an operator and not by an cluster manager.
It calls secondary because heartbeat will use datadisk anyway to
switch it into primary mode. -- I am not absolutely shure if it will
stay this way.

-Philipp


* Thomas Stinner <t.stinner@example.com> [010526 13:58]:
> Hello together,
>
> i'm currently running drbd 0.5.8.
>
> i stepped over some problems with the perl-script drbd
> (cvs revision 1.5)
>
> When i say yes to the question
>
> Do you want to abort waiting for other server and make this one primary?
>
> i get some errors.
>
> First, there seems to be a problem with the parameters of the function
> increase_h_count, i think this should probably be this way:
>
> --- ./drbd Fri May 25 11:53:50 2001
> +++ /etc/rc.d/init.d/drbd Sat May 26 13:45:41 2001
> @@ -384,10 +384,12 @@
> $pid = wait();
> if($pid == $user) {
> my $res;
> -
> - kill 'INT',keys %syncers;
> +
> + kill 'INT',keys(%syncers);
> + print "KILL RETURNED: $!\n";
> +
> foreach $res (keys %syncers) {
> - increase_h_count($res,$conf{$res});
> + increase_h_count(%syncers->{$res},$conf{%syncers->{$res}});
> }
> last;
>
>
> The second problem is the kill, which doesn't seem to succeed. I always
> get an Illegal Seek (ESPIPE). Probalby because of the backticks within
> wait_ready (around line 204). I'm not a perl guru, so i might be wrong.
>
>
> I'm also not sure about increase_h_count, it first makes the node the
> primary and immediately after it makes it the secondary ???
>

-Philipp