DataStax Academy FAQ

DataStax Academy migrated to a new learning management system (LMS) in July 2020. We are also moving to a new Cassandra Certification process so there are changes to exam bookings, voucher system and issuing of certificates.

Check out the Academy FAQ pages for answers to your questions:


question

chandrasekar.b03_190734 avatar image
chandrasekar.b03_190734 asked ·

Why does nodetool getendpoints return results for non-existent partitions?

As already explained in other post, https://community.datastax.com/answers/4765/view.html I have followed the same procedure as listed there.

Note: I have used docker-compose.yaml included as a material from week 3 of Cloud Native Workshop series that runs on 3 node cluster.

I created a keyspace killrvideo with class simplestrategy and RF =1. I have a table named videosbytag where I have a column tag with 3 partitions named

  • 'Cassandra'
  • 'datastax'
  • 'Cloud Native'

I executed nodetool getendpoints command for knowing where in the node my data resides...

$ nodetool getendpoints killrvideo videosbytag 'Cassandra'
174.18.0.3
$ nodetool getendpoints killrvideo videosbytag 'datastax'
174.18.0.4

Seems like I understood the process unless when i see this...

$ nodetool getendpoints killrvideo videosbytag 'Community.Datastax'
174.18.0.4

Where Community.Datastax is not a partition or any kind of data in my keyspace.

Why does it print like this for this unknown data?

partitioner
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered ·

The command nodetool getendpoints is a tool which uses a node's partitioner hash algorithm to calculate the following:

  • the token value of a given partition (using the partitioner's hash function), and
  • the endpoints (replicas) which own the token (not the partition).

The command is a calculator -- it does not perform a Cassandra read to find where the partition lives. I think that's the distinction that you missed.

You can run getendpoints on random keys:

  • apples
  • "It's a wonderful life"
  • b54adc00-67f9-11d9-9669-0800200c9a66
  • 42

These partitions do not have to exist in the database since that's irrelevant. Again, all it does is calculate the hash of the partition and work out the replicas for the token. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

bettina.swynnerton avatar image
bettina.swynnerton answered ·

Hi @chandrasekar.b03_190734,

nodetool getendpoints provides the IP addresses or names of replicas that own the partition key.

The partitioner will return a token for any key that you provide. Cassandra will then return an endpoint, whether or not data exists on the identified node for that token.

See here for the documentation:

https://docs.datastax.com/en/cassandra-oss/3.0/cassandra/tools/toolsGetEndPoints.html

I hope this helps!

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

That clearly explains my question.

Thanks a lot!!!!

0 Likes 0 · ·