mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-31 12:06:44 +00:00
[v2: fix check for static column (don't check if the schema is not compound) and move want-static-columns flag inside the filtering context to avoid changing all the callers.] When a CQL request asks to read only a range of clustering keys inside a partition, we actually need to read not just these clustering rows, but also the static columns and add them to the response (as explained by Tomek in issue #1568). With the current code, that CQL request is translated into an sstable::read_row() with a clustering-key filter. But this currently only reads the requested clustering keys - NOT the static columns. We don't want sstable::read_row() to unconditionally read the from disk the static columns because if, for example, they are already cached, we might not want to read them from disk. We don't have such partial-partition cache yet, but we are likely to have one in the future. This patch adds in the clustering key filter object a flag of whether we need to read the static columns (actually, it's function, returning this flag per partition, to match the API for the clustering-key filtering). When sstable::read_row() sees the flag for this partition is true, it also request to read the static columns. Currently, the code always passes "true" for this flag - because we don't have the logic to cache partially-read partitions. The current find_disk_ranges() code does not yet support returning a non- contiguous byte range, so this patch, if it notices that this partition really has static columns in addition to the range it needs to read, falls back to reading the entire partition. This is a correct solution (and fixes #1568) but not the most efficient solution. Because static columns are relatively rare, let's start with this solution (correct by less efficient when there are static columns) and providing the non- contiguous reading support is left as a FIXME. Fixes #1568 Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <1471124536-19471-1-git-send-email-nyh@scylladb.com>