Skip to content

Conversation

grooverdan
Copy link

Since 716621d, opt_mem is
a pure flag. However it is assigned to the value of $MTR_MEM.

This leads to conflicts when MTR_MEM=/xxx/yy ./mtr --mem is
invoked. Here the --mem option overrided opt_mem leaving the
default path to be chosen.

This change makes when MTR_MEM set, opt_mem, the flag, is also
set. Both the environment and flag can no be set without conflicting.

/run/shm is added to the beginning of the path as its now used
in a few distros and is conceptually better than /dev for its purpose.

Since 716621d, opt_mem is
a pure flag. However it is assigned to the value of $MTR_MEM.

This leads to conflicts when MTR_MEM=/xxx/yy ./mtr --mem is
invoked. Here the --mem option overrided opt_mem leaving the
default path to be chosen.

This change makes when MTR_MEM set, opt_mem, the flag, is also
set. Both the environment and flag can no be set without conflicting.

/run/shm is added to the beginning of the path as its now used
in a few distros and is conceptually better than /dev for its purpose.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
@grooverdan
Copy link
Author

I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

@bjornmu
Copy link
Member

bjornmu commented Dec 21, 2016

I'm afraid it's a bit more complicated than just adding /run/shm to the list of alternatives. On Ubuntu 14.04 they have changed the ramdisk to /run/shm but have kept /dev/shm as a softlink. This was causing some tests to fail because they would compare a path as known by mtr with /dev/shm with one known by the server. But the path reported by the server had been canonicalized to /run/shm and this did not match. With your patch this would not be a problem as it will use /run/shm.

However, sometime between Ubuntu 14.04 and 16.04 they switched back to using /dev/shm and now /run/shm is a softlink instead. Since /run/shm exists and is first in your list mtr will use that and now some tests will fail because the server uses /dev/shm.

What mtr really needs to do is pick the first path in the list which is not a softlink. So adding /run/shm to the list is good but you'll also need this additional check.

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment:
"I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it."
Thanks

@mysql-oca-bot
Copy link

Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=84299 for updates.
Thanks

grooverdan added a commit to grooverdan/mariadb-server that referenced this pull request Dec 22, 2016
From Bjorn Munch it seems symlinks can confuse some
tests. Lets just avoid those.

(ref: mysql/mysql-server#116 (comment))

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
grooverdan added a commit to grooverdan/mariadb-server that referenced this pull request Jan 10, 2017
From Bjorn Munch it seems symlinks can confuse some
tests. Lets just avoid those.

(ref: mysql/mysql-server#116 (comment))

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
grooverdan added a commit to grooverdan/mariadb-server that referenced this pull request Feb 19, 2017
From Bjorn Munch it seems symlinks can confuse some
tests. Lets just avoid those.

(ref: mysql/mysql-server#116 (comment))

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
elenst pushed a commit to MariaDB/server that referenced this pull request Feb 19, 2017
…ner (10.0) (#289)

* Revert "Make --mem a pure flag. If there is need to specifically set the location"

This reverts commit 716621d.

* MDEV-11619: mtr: when --mem is pure flag, conflicts with $MTR_MEM

Conflicts occurs when MTR_MEM=/xxx/yy ./mtr --mem is invoked. Here
the --mem option overrides opt_mem leaving the default path to be chosen.

This change makes when MTR_MEM set, opt_mem, the flag, is also
set. Both the environment and flag can no be set without conflicting.

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>

* MDEV-11619: if opt_mem is a path include it first

* MDEV-11619: MTR_MEM locations - don't follow symlinks

From Bjorn Munch it seems symlinks can confuse some
tests. Lets just avoid those.

(ref: mysql/mysql-server#116 (comment))

Signed-off-by: Daniel Black <daniel.black@au.ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants