forked from scylladb/scylladb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sstables: don't forget to read static row
[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 scylladb#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 scylladb#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 scylladb#1568 Signed-off-by: Nadav Har'El <nyh@scylladb.com> Message-Id: <1471124536-19471-1-git-send-email-nyh@scylladb.com>
- Loading branch information
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters