Originally from the User Slack
@Jeffery_Utter: Do LWT’s lock across a larger area than the partition key? Like does it end up hashing the partition key into a bucket and then locking the bucket? (oversimplified, I’m sure)
@dor: LWT only guarantee a single partitions consistency. One can batch but multiple coordinators can exists. So only single partition consistency really exists with LWT
@Jeffery_Utter: Hmm, I think I follow that, but If I have two partition keys that map to the same token, can only one of those be executed concurrently?
@avi: The lock has token granularity, so if two partition keys hash to the same token, they will indeed be serialized
@Jeffery_Utter: Got it. And that defaults to 256 tokens per node? Is that correct? So if we’re seeing contention on lwts adding nodes would help?
@avi: No, the token-per-node are just range boundaries. A partition key’s token is a 64-bit hash of the key, and always has the full 64-bit range. Accidental collisions are very rare.
If you’re seeing contention, it’s likely on the same key