Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
-
None
-
3
Description
See comments on this patch from NCBC-3666.
Motivation
Previously, the Key encoding happened in the VBucketMapper when hashing the Key to get its associated VBucket ID.
If the encoded key was too long (>250 bytes), A System exception would be thrown as the bytes don't fit in the constrained span.
We want to check the byte length of keys passed for all KV operations that apply, and throw a Couchbase.InvalidArgumentException if the encoding fails.
NCBC-3666 added this Length check upfront for all KV operations, but we want to investigate the performance cost of:
1. Encoding the key twice (once in CouchbaseCollection/Operationbase, once in VBucketMapper)
2. Encoding once in OperationBase and throwing there (fail-fast)
3. Encoding once in VBucketMapper and throwing there (goes through Retry)