Commit Graph

15 Commits

Author SHA1 Message Date
Raphael S. Carvalho
eed2a7d065 sstables: group sstable components that can be shared among shards
We intend to share immutable sstable components among shards to
reduce excessive memory usage when resharding shared sstables.

This change is about grouping those components into a structure,
and using foreign ptr to make sure that the structure will be
deleted by whichever shard created it.

Signed-off-by: Raphael S. Carvalho <raphaelsc@scylladb.com>
2017-01-06 15:16:19 -02:00
Pekka Enberg
38a54df863 Fix pre-ScyllaDB copyright statements
People keep tripping over the old copyrights and copy-pasting them to
new files. Search and replace "Cloudius Systems" with "ScyllaDB".

Message-Id: <1460013664-25966-1-git-send-email-penberg@scylladb.com>
2016-04-08 08:12:47 +03:00
Benoît Canet
3b1d3d977d exceptions: Shutdown communications on non file I/O errors
Apply the same treatment to non file filesystem I/O errors.

Signed-off-by: Benoît Canet <benoit@scylladb.com>
Message-Id: <1458154098-9977-2-git-send-email-benoit@scylladb.com>
2016-03-17 15:02:54 +02:00
Glauber Costa
8e4bf025ae sstables: wire priority for read path
All the SSTable read path can now take an io_priority. The public functions will
take a default parameter which is Seastar's default priority.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2016-01-25 15:20:38 -05:00
Glauber Costa
56c11a8109 sstables: wire priority for write path
All variants of write_component now take an io_priority. The public
interfaces are by default set to Seastar's default priority.

Signed-off-by: Glauber Costa <glauber@scylladb.com>
2016-01-25 15:20:38 -05:00
Avi Kivity
d5cf0fb2b1 Add license notices 2015-09-20 10:43:39 +03:00
Avi Kivity
c3b2623f12 sstables: filter: speed up bloom filter read/write
Bloom filter loading and saving is slow with single-bit access to the bitmap,
causing latency spikes of ~100ms for 20MB sstables.  Larger sstables will be
much worse.

Fix by using the newly introduced large_bitmap bulk load/save methods.  With
this, the maximum observed task latency was 16ms.

Fixes #299 (partially at least; larger bitmaps may require more work still).
2015-09-08 14:09:59 +02:00
Glauber Costa
2bfc2697c1 sstables: add method to grab filter size
This is one of the statistics we need to export

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 19:18:54 -05:00
Glauber Costa
7f04c1bf9b sstables: simplify filter tracker
The current filter tracker uses a distributed mechanism, even though the values
for all CPUs but one are usually at zero. This is because - I wrongly assumed -
that when using legacy sstables, the same sstable would be serving keys for
multiple shards, leading to the map reduce being a necessary operation in this
case.

However, Avi currently point out that:

"It is and it isn't [the case].  Yes the sstable will be loaded on multiple cores, but
each core will have its own independent sstable object (only the files on disk
are shared).

So to aggregate statistics on such a shared sstables, you have to match them by
name (and the sharded<filter_tracker> is useless)."

Avi is correct in his remarks. The code will hereby be simplified by keeping
local counters only, and the map reduce operation will happen at a higher
level.

Also, because the users of the get methods will go through the sstable, we can
actually just move them there. With that we can leave the counters private to
the external world in the filter itself.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-08-24 19:17:31 -05:00
Avi Kivity
c51292e792 sstables: switch from vector<> to deque<>
Large vectors require contiguous storage, which may not be available (or may
be expensive to obtain).  Switch to deque<> instead, which allocates
discontiguous storage.

Allocation problems were observed with the summary and with the bloom
filter bitmaps.
2015-08-23 12:22:49 +03:00
Avi Kivity
1bb840bb72 sstables: use large_bitset in bloom filter
Avoids allocation failures due to multi-megabyte filters.
2015-08-23 12:22:49 +03:00
Avi Kivity
3a5e3c8829 sstables: de-futurize write path
The sstables write path has been partially de-futurized, but now creates a
ton of threads, and yet does not exploit this as everything is serialized.

Remove those extra threads and futures and use a single thread to write
everything.  If needed, we'll employ write-behind in output_stream to
increase parallelism.

Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-08-03 20:33:59 +03:00
Glauber Costa
4cd143de87 filter_tracker: define and call a stop method
All sharded services "should" define a stop method. Calling them is also
a good practice. For this one specifically, though, we will not call stop.
We miss a good way to add a Deleter to a shared_ptr class, and that would
be the only reliable way to tie into its lifetime.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-07-23 11:11:57 -04:00
Glauber Costa
272b97f01c sstables: initialize filter_tracker when filter file is read
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-06-18 11:17:29 -04:00
Glauber Costa
d03654c3d9 sstables: bloom filter implementation
Use the provided filter instead of always returning true. For existing tables,
this arrives from the bloom filter file. We don't yet fully write a bloom
filter file.

Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
2015-05-19 11:22:41 -04:00