Commit Graph

4300 Commits

Author SHA1 Message Date
Vlad Zolotarov
7e73afccab locator: local_strategy: register a short name creator
Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Vlad Zolotarov
e47e0dcde9 locator: moved endpoint_dc_rack from db::system_keyspace to locator namespace
This is meant to resolve to dependecy loop between token_metadata.hh
and system_keyspace.hh.

Signed-off-by: Vlad Zolotarov <vladz@cloudius-systems.com>
2015-06-29 14:35:47 +03:00
Avi Kivity
e85197a806 db: fix std::terminate() called during failed find_schema()
One of the find_schema variants calls a find_uuid() that throws out_of_range,
without converting it to no_such_column_family first.  This results in
std::terminate() being called due to exception specifications.

Fix by converting the exception.
2015-06-29 13:32:28 +03:00
Avi Kivity
b3c84bb7e1 Merge "Compression parameters in schema definitions" from Paweł
"When compressor_parameters was introduced it only performed properties
validation, but wasn't properly wired to the rest of the code and the
compression information never made it to the final schema object.

This patchset changes that, now compression parameters are correctly processed
by schema builder as well written and read from system tables. Updated test
case makes sure that not only incorrect values are rejected during validation,
but also that correct values really are set in the created schema."
2015-06-29 12:00:30 +03:00
Avi Kivity
f54299c1ea Merge "Adding the collectd API" from Amnon
"V2 Change how the information is gothered from the CPUs.  As a result of the
change, each function call in the parallel_for_each holds its own copy of the
ID, following that the get_collectd_value method was changed to get a const
reference, to prevent the redundant creation of a shared_ptr from the local
copy.

This series adds an API for the collectd. After applying the series the
collectd will be available from the API."
2015-06-29 11:21:40 +03:00
Avi Kivity
96ccde7a99 Merge seastar upstream 2015-06-29 11:21:23 +03:00
Paweł Dziepak
1c84a7231a tests/cql: improve compression tests
Check whether the created tables have actually the appropriate
compression parameters set.

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:43:14 +02:00
Paweł Dziepak
9164e20a5d cql3: remove cf_prop_defs::apply_to_schema()
This function isn't called by anything, all schema creation logic should
be in apply_to_builder().

Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:36:32 +02:00
Paweł Dziepak
bad8f7cc72 db/legacy_schema_tables: support compression_parameters
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:36:28 +02:00
Paweł Dziepak
9606b3f911 schema_builder: add set_compressor_params()
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:36:22 +02:00
Paweł Dziepak
a0424d5d27 compressor: allow an empty map of options
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:36:14 +02:00
Paweł Dziepak
b520ef6172 compress: generate a std::map<sstring, sstring> of options
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:35:01 +02:00
Paweł Dziepak
f4ce125422 compress: use std::optional for chunk length and crc check chance
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:30:31 +02:00
Paweł Dziepak
9134381638 compress: accept both qualified and unqualified class names
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 09:05:50 +02:00
Paweł Dziepak
c51a430020 compress: "DeflateCompressor" is not compressor::none
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-06-29 08:25:13 +02:00
Avi Kivity
7842ac8db6 doc: document file I/O 2015-06-28 22:42:06 +03:00
Avi Kivity
8ca32adbde Merge "file::close() support"
close() is a blocking call, so it must be called in the I/O thread, not
the main reactor thread.  To do that, we need a file::close() method that
can return a future.
2015-06-28 21:50:46 +03:00
Avi Kivity
ae38e95bb2 file: uninline posix_file_impl destructor 2015-06-28 20:42:30 +03:00
Avi Kivity
7e66cc02e1 tests: close file in fileiotest 2015-06-28 20:40:37 +03:00
Avi Kivity
8039544806 file: warn if file::close() was not called in time 2015-06-28 20:39:06 +03:00
Avi Kivity
c05c7c09cf fstream: close file on stream close 2015-06-28 20:36:23 +03:00
Avi Kivity
9c9d943e3a file: add close() method
Closing a file can both expose latent errors that did not have the
opportunity to be reported earlier, and also may block.  While both
are unlikely in the case of O_DIRECT files, better not to risk it.
2015-06-28 20:36:15 +03:00
Raphael S. Carvalho
6dcf136702 sstables: enable trim_to_size option of compressed_file_output_stream
Following Nadav's discovery of the problem with large writes to output stream,
it turns out that compressed_file_output_stream also needs the option trim_to_
size enabled. Otherwise, a write to compressed_file_output_stream larger than
_size would result in a buffer larger than chunk size being flushed, which is
definitely wrong.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
Reviewed-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-28 19:57:07 +03:00
Avi Kivity
a7580f5dab Merge seastar upstream
Conflicts:
	test.py
2015-06-28 19:43:28 +03:00
Nadav Har'El
f687ec40a3 fstream: catch bug early
the file_data_sink_impl::put() code assumes it is always called on buffers
with size multiple of dma alignment (4096), except the *last* one. After
writing one unaligned-size buffer, further writes cannot continue because
the offset into the file no longer has the right alignment! If a caller
does try to do that, there is a bug in the caller (it's not a run-time error,
it's a design bug), and better discover it quickly with an assert, as I do
in this patch.

I had such a caller in an example application, and it took me a whole day
of debugging just to figure out that this is where the caller actually had
a bug.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Reviewed-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-28 19:31:00 +03:00
Nadav Har'El
b306cee41e fstream: fix behavior of large writes to output stream
Our file-output code contains various layers making sometimes contradictory
assumptions, and it is a real art-form to make it all work together.
They usually do work together well, but there was one undetected bug for
large writes to a file output stream:

The problem is what happens when we try to write a large buffer (larger
than the output stream's buffer) in one output_stream::write() call.
By default, output_stream uses the efficient, zero-copy, implementation
which calls the underlying data sink's put function on the entire written
buffer, without copying it to the stream's buffer first.

Unfortunately, this solution does NOT work on *file* output streams.
Because of our use of AIO and O_DIRECT, we can only write from aligned
buffers, and at aligned (multiple of dma_alignment) sizes. Even a large
size cannot be fully written if not a multiple of dma_alignment, and
the need to align the buffers, and data already on the output_stream,
complicate things further.

Amazingly, we already had an option "_trim_to_size" in output_stream to
do the right thing, and we just need to enable it for file output stream.
In special cases (aligned position, aligned input buffer) it might be
possible to do something even more efficient - zero copy and just one
write request - but in the general case, _trim_to_size is exactly what
we needed.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-28 19:29:19 +03:00
Amnon Heiman
aa73311289 adding the collectd implementation
This adds the implementation for:
get_collectd - return a single collectd value
get_collectd_items - list the registerred collectd
2015-06-28 17:37:59 +03:00
Avi Kivity
6ac01770df core: avoid fstat() call in reactor thread
When creating a file object, we call fstat() to determine whether it's
a block device or a regular file.  While unlikely, the fstat() call can
block.  Use an ioctl() that we expect to fail on regular files instead.
2015-06-28 17:14:43 +03:00
Amnon Heiman
afa6eb8d94 Adding the collectd swagger definition API
The collectd API has method for listting the available collectd register
objects and to retrieve the values.
2015-06-28 17:14:12 +03:00
Amnon Heiman
40fb823b2e scollectd API get_collectd_value to use const ref
After the implementation of the code that uses the scollectd API was
modified, the get_collectd_value gets the collectd ID as a const
reference, to remove unnessary creation of shared_ptr.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-06-28 17:14:12 +03:00
Nadav Har'El
20d2154c4d shared_ptr: add use_count()
Add a use_count() method for shared_ptr, like std::shared_ptr has.

We already had such a method for lw_shared_ptr, but not for shared_ptr.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-28 15:14:56 +03:00
Avi Kivity
ab63138134 tests: add fileiotest to regression test suite 2015-06-28 14:39:17 +03:00
Nadav Har'El
9c7f1744b3 sstables: add missing virtual destructor
A base class with virtual functions should also have a virtual destructor,
so if someone deletes it by the base class pointer, the concrete class's
destructor will be called.

I thought this missing virtual destructor is to blame for a bug I was
hunting, but it's not - but it's still worth adding this missing definition.

The silly "default" definition of the move constructor is also necessary,
because when you define the destructor explicitly, the compiler no longer
defines any constructors implicitly for you.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-28 13:28:12 +03:00
Nadav Har'El
7327e246c1 tests: convert fileiotest.cc to Boost test case
convert fileiotest.cc to Boost test case, making it easier to see what
is being tested, and to add more file io tests.

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-28 12:35:03 +03:00
Avi Kivity
7e587c0083 Merge "streaming update" from Asias 2015-06-28 12:34:20 +03:00
Nadav Har'El
c7b7cf3ca4 sstables write: don't hide exception
Our sstable code currently has a bug (not solved by this patch) in writing
large summary files, where several aio write operations are done and one of
them fails with an EINVAL.

Unfortunately and inexplicably, sstable::write_simple simply *hides* this
exception (catches it and ignores it), so the write never knows it fails,
and we only get an exception later when sstable::write_components() tries
to load() the sstable it just created.

So in this patch, I remove the hiding of the exception, and now when writing
an sstable with 1,000,000 partitions, I see this in the output:

	failed to write sstable: Invalid argument

Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
2015-06-28 12:04:06 +03:00
Avi Kivity
e10b29921a README: fix typos and paramter syntax
Noticed by Gleb.
2015-06-28 10:24:48 +03:00
Avi Kivity
0bfb96c011 Merge "Make decorated_key comparable with ring_position" from Tomasz 2015-06-28 10:13:59 +03:00
Raphael S. Carvalho
c5eff7d263 sstables: use move semantics when updating stats
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-28 10:10:36 +03:00
Raphael S. Carvalho
261f1f75d0 sstables: update stats when writing tombstones
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-28 10:10:36 +03:00
Avi Kivity
4cb03b92be Merge seastar upstream 2015-06-28 10:07:00 +03:00
Raphael S. Carvalho
f5ce89b203 core: introduce function to rename file
Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-06-28 10:06:06 +03:00
Asias He
c0cd69517a streaming: Implement stream_session::file_sent 2015-06-26 15:04:33 +08:00
Asias He
6a92924a75 streaming: Add stream_session::on_error 2015-06-26 14:49:24 +08:00
Asias He
1134b99610 streaming: Add stream_session::on_initialization_complete 2015-06-26 14:39:22 +08:00
Asias He
8aa6c8f3a9 streaming: Wire up two more close_session calls 2015-06-26 14:25:52 +08:00
Asias He
f7542e7cf0 streaming: Implement stream_session::add_transfer_files 2015-06-26 14:24:10 +08:00
Asias He
66a9f92df9 streaming: Move stream_coordinator code to source file 2015-06-26 10:07:57 +08:00
Asias He
78f5aaf265 streaming: Add stream_coordinator::get_peers 2015-06-26 09:45:32 +08:00
Asias He
774f677097 streaming: Add stream_coordinator::is_receiving 2015-06-26 09:43:01 +08:00