6 messages in com.mysql.lists.clusterRe: Strange Query Results
FromSent OnAttachments
Michael Caplan28 Jul 2006 11:43 
Michael Caplan28 Jul 2006 12:37 
Adam Dixon28 Jul 2006 15:41 
Adam Dixon28 Jul 2006 15:47 
Michael Caplan28 Jul 2006 19:59 
Simon Garner31 Jul 2006 17:13 
Subject:Re: Strange Query Results
From:Simon Garner (sgar@expio.co.nz)
Date:07/31/2006 05:13:47 PM
List:com.mysql.lists.cluster

This is a known issue I think.

The workaround is to change the id column to be a char(32) instead of varchar(32).

regards, -Simon

On 29/07/2006 6:43 a.m., Michael Caplan wrote:

Hi there,

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