Are AQL query results supposed to include replica copies?

When I load 10 records { cust_name, cust_type_cd } into 2 nodes cluster,

When I do “select * from test”

[root@cos07 ~]# aql

Aerospike Query

Copyright 2013 Aerospike. All rights reserved.

aql> select * from test

±------------------------±-------------+

| cust_name | cust_type_cd |

±------------------------±-------------+

| “lee000000000000000569” | “P01” |

| “lee000000000000000576” | “P01” |

| “lee000000000000000577” | “P01” |

| “lee000000000000000575” | “P01” |

| “lee000000000000000571” | “P01” |

| “lee000000000000000573” | “P01” |

| “lee000000000000000574” | “P01” |

| “lee000000000000000570” | “P01” |

| “lee000000000000000572” | “P01” |

| “lee000000000000000578” | “P01” |

| “lee000000000000000573” | “P01” |

| “lee000000000000000574” | “P01” |

| “lee000000000000000570” | “P01” |

| “lee000000000000000572” | “P01” |

| “lee000000000000000578” | “P01” |

±------------------------±-------------+

15 rows in set (0.209 secs)

It seems like aql is popping the replica results too, Is this normal behavior? if so, how can I get query result from only the master records?

When I do the same with one node cluster I get the result I expect.

[root@cos07 ~]# aql

Aerospike Query

Copyright 2013 Aerospike. All rights reserved.

aql> select * from test

±------------------------±-------------+

| cust_name | cust_type_cd |

±------------------------±-------------+

| “lee000000000000000569” | “P01” |

| “lee000000000000000576” | “P01” |

| “lee000000000000000573” | “P01” |

| “lee000000000000000577” | “P01” |

| “lee000000000000000575” | “P01” |

| “lee000000000000000574” | “P01” |

| “lee000000000000000570” | “P01” |

| “lee000000000000000572” | “P01” |

| “lee000000000000000578” | “P01” |

| “lee000000000000000571” | “P01” |

±------------------------±-------------+

10 rows in set (0.025 secs)

Hi-

Thank you for bringing up this issue.

To answer your question, no, this is not the expected behavior. You should see the same results when you run the same AQL query against the same namespace from either node in the cluster.

I tested here with 3.5.9, and I was unable to reproduce the behavior that you described.

Are you still able to reproduce? Would you confirm if migrations are taking place when you see this issue? Is the issue consistent/intermittent/a one-off issue?

Would you also confirm the version of Aerospike on each of the nodes?

Thank you for your time,

-DM

Hi

I tested with aerospike-server-community-3.5.9-el6 on both servers and aerospike-server-community-3.5.12-el6 too.

I used default /etc/aerospike/aerospike.conf

I put 10 records into the test.demoset.

The issue is very consistent, when I query “aql> select * from test”, it seems like it is popping all the master records + the replica records in the same node.

If I get 15 records result on server#1, I also get 15 records on server#2,

If I get 17 on server#1, 13 on server#2… and so on. (The results are consistent until I reset the servers and put the data again.)

=========================================================================

FYI

When I test with 3 node cluster

I get multiple(5) results when I query namespaces/sets.

aql> show namespaces

±-----------+

| namespaces |

±-----------+

| “test” |

| “bar” |

±-----------+

2 rows in set (0.000 secs)

±-----------+

| namespaces |

±-----------+

| “test” |

| “bar” |

±-----------+

2 rows in set (0.000 secs)

±-----------+

| namespaces |

±-----------+

| “test” |

| “bar” |

±-----------+

2 rows in set (0.001 secs)

±-----------+

| namespaces |

±-----------+

| “test” |

| “bar” |

±-----------+

2 rows in set (0.000 secs)

±-----------+

| namespaces |

±-----------+

| “test” |

| “bar” |

±-----------+

2 rows in set (0.000 secs)

OK

aql> show sets

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| n_objects | set-enable-xdr | set-stop-write-count | ns_name | set_name | set-delete | set-evict-hwm-count | ±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| 5 | “use-default” | 0 | “test” | “event” | “false” | 0 |

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

1 row in set (0.000 secs)

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| n_objects | set-enable-xdr | set-stop-write-count | ns_name | set_name | set-delete | set-evict-hwm-count | ±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| 10 | “use-default” | 0 | “test” | “event” | “false” | 0 |

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

1 row in set (0.000 secs)

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| n_objects | set-enable-xdr | set-stop-write-count | ns_name | set_name | set-delete | set-evict-hwm-count | ±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| 10 | “use-default” | 0 | “test” | “event” | “false” | 0 |

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

1 row in set (0.000 secs)

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| n_objects | set-enable-xdr | set-stop-write-count | ns_name | set_name | set-delete | set-evict-hwm-count | ±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| 5 | “use-default” | 0 | “test” | “event” | “false” | 0 |

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

1 row in set (0.000 secs)

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| n_objects | set-enable-xdr | set-stop-write-count | ns_name | set_name | set-delete | set-evict-hwm-count | ±----------±---------------±---------------------±--------±---------±-----------±--------------------+

| 5 | “use-default” | 0 | “test” | “event” | “false” | 0 |

±----------±---------------±---------------------±--------±---------±-----------±--------------------+

1 row in set (0.000 secs)

OK

Hello-

I was discussing this with some others here.

Do any of the nodes in the cluster have multiple NICs? Do you have access-address configured in the .conf files?

Thank you for your time,

-DM

Yes, I think I found out the reason for the issue,

I was using multiple IP address utilizing 2 NICs(1G & 10G)

When I configured service address to just 1 of the IP that the node was using,

the problem disappeared.

So the problem I think was because AQL was getting a single master copy from the self-node

and 2(duplicate) master copies from all of the other nodes…

Please correct me if my assumption is incorrect.

Thank you, very much.

1 Like

I think that your assumption is correct, and I’m glad that the issue is resolved.

Thank you for your time,

-DM