MySQL Forums
Forum List  »  NDB clusters

Strange Query Results
Posted by: Michael Caplan
Date: July 28, 2006 11:48AM

Hi there,

(I hope it is not totally rude to cross post been the email cluster email list and the folurm, but it looks like the two have different readers)

I'm totally new to mysql cluster, and am experiencing some strange issues with my query results. I'm running a web application against a MySQL 5.0.22 cluster setup (1 management node, two data cluster nodes, and two sql nodes, running off of three boxes), and am having very strange results with session data stored in a table.

I am using PHP sessions with a custom handler which ties session data with Mysql. All session data gets stored in a mysql table. Nothing novel there. However, since moving to cluster, I have been having irregular results with session reinstantiation depending on what sql node the session data is being accessed from. I've also experienced strange results when querying the session data directly (mysql client). Check these two queries out:

mysql> select id from liveuser_sessions where id = 'k1rumm4pfg2nps0vk1hgrbl953';
+----------------------------+
| id |
+----------------------------+
| k1rumm4pfg2nps0vk1hgrbl953 |
+----------------------------+
1 row in set (0.04 sec)

Okay, all good. ID "k1rumm4pfg2nps0vk1hgrbl953" is my newly created session. Lets grab all columns re: my session:

mysql> select * from liveuser_sessions where id = 'k1rumm4pfg2nps0vk1hgrbl953';
Empty set (0.00 sec)

What the? It was just there... Was I dreaming...?

mysql> select id from liveuser_sessions where id = 'k1rumm4pfg2nps0vk1hgrbl953';
+----------------------------+
| id |
+----------------------------+
| k1rumm4pfg2nps0vk1hgrbl953 |
+----------------------------+
1 row in set (0.04 sec)

How the...?


As I mentioned above, I'm very new to the world of mysql cluster, and have no idea why this is taking place. It worked a-okay off of a myisam with no issue. Any ideas? Below is details about my table and management node config.

Thanks,

Michael



mysql> describe liveuser_sessions;
+--------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------+------------------+------+-----+---------+-------+
| id | varchar(32) | NO | PRI | NULL | |
| access | int(10) unsigned | YES | MUL | NULL | |
| data | text | YES | | NULL | |
+--------+------------------+------+-----+---------+-------+
3 rows in set (0.00 sec)

mysql> SHOW INDEX from liveuser_sessions;
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| Table | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment |
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
| liveuser_sessions | 0 | PRIMARY | 1 | id | A | 26 | NULL | NULL | | BTREE | NULL |
| liveuser_sessions | 1 | access | 1 | access | A | 26 | NULL | NULL | YES | BTREE | NULL |
+-------------------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+
2 rows in set (0.00 sec)


[NDBD DEFAULT]
NoOfReplicas=2
DataMemory=500M
IndexMemory=100M
MaxNoOfAttributes = 2000
MaxNoOfOrderedIndexes = 256
MaxNoOfUniqueHashIndexes = 256

# Managment Server
[NDB_MGMD]
HostName=XXX.XXX.XXX.12 # the IP of THIS SERVER
DataDir=/var/lib/mysql-cluster

# Data node A
[NDBD]
HostName=XXX.XXX.XXX.245 # the IP of the FIRST SERVER
DataDir=/var/lib/mysql-cluster

# Data node B
[NDBD]
HostName=XXX.XXX.XXX.246 # the IP of the SECOND SERVER
DataDir=/var/lib/mysql-cluster

# 2 MySQL Clients
# I personally leave this blank to allow rapid changes of the mysql clients;
# you can enter the hostnames of the above two servers here. I suggest you dont.
[MYSQLD]
hostname=XXX.XXX.XXX.245

[MYSQLD]
hostname=XXX.XXX.XXX.246

Options: ReplyQuote


Subject
Views
Written By
Posted
Strange Query Results
2920
July 28, 2006 11:48AM
1496
July 28, 2006 12:38PM
1510
July 28, 2006 12:55PM
1469
July 28, 2006 08:10PM
1455
July 29, 2006 09:50AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.