"This series implements CQL topology and status change events. We send
out all other events except for the "leave cluster" topology event which
doesn't have the relevant code converted in storage service.
This fixes#88 and fixes #89."
The last two arguments to vector::insert() are flipped which causes us
to fill the vector with 'b' bytes of value 0x01. Switch to the single
element insertion variant to fix the issue.
Spotted by dtest push notification tests.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
We need a container which can be used with compacting
allocators. "bytes" can't be used with compacting allocator because it
can't handle its external storage being moved.
This reverts commit 6b2be41df00bc42331eccd423b7031b345cf979d; tests should
work without a data directory, so let's find why they don't and fix it
instead.
ASan does not like commit 05c23c7f73
("database: Add create_keyspace_on_all() helper"):
==8112==WARNING: AddressSanitizer failed to allocate 0x7f88b84fc690 bytes
==8112==AddressSanitizer's allocator is terminating the process instead of returning 0
==8112==If you don't like this behavior set allocator_may_return_null=1
==8112==Sanitizer CHECK failed: ../../../../libsanitizer/sanitizer_common/sanitizer_allocator.cc:147 ((0)) != (0) (0, 0)
I was not able to determine the source of the bug. Make ASan happy by
reverting the code movement and using the "cpu zero" trick we use for
table creation.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
gcc 4.9 fails to compiles the following legal code (which compiles fine on
gcc 5.1):
#include <unordered_set>
std::unordered_set<int> hi() {
return {};
}
Work around this problem to make Scylla compile on gcc 4.9 again.
Note that this bug is specific to std::unordered_set - we have other places
in the code code which "return {}" for std::set, and those work fine.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
It is needed for db.get_version(). I really hated to pass &db everywhere
If we had a global helper function like get_local_db(), life will be much
easier.
Use seastar::async to simplify the code. This code is only executed
during boot up, so it is fine to use seastar::async.
More commented out code are enabled.
We are currently failing the sstable test. The reason is that we use the store()
function for test purposes, and that function does not store the TOC component.
It was removed by Aviccident in 3a5e3c88.
Because that function is only used for testing purposes, it doesn't need to write
the Index and Data components: we can then remove them from the list.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
When probing for the type, I have made the classical mistake of using
as a parameter part of a structure that is moved into the capture. That
is what broke our tests.
But also, when stat'ing, de.name will give us only the component relative to
the current path. We need to add the directory so the stat will succeed.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
Our directory scanner currently requires a type to be passed, and we have a
FIXME saying that we should stat when there is none. In some filesystems,
in particular, XFS, getdents won't return a type, meaning we should manually
probe it.
Signed-off-by: Glauber Costa <glommer@cloudius-systems.com>
The code is merge_tables() is a twisted maze of tricks that is hard to
restructure so that event notification can be done cleanly like with
keyspaces.
The problem there is that we need to run bunch of database operations
for the merging that really need to happen on all the shards. To fix
the issue, lets cheat a little and simply only run CQL event
notification on cpu zero.
This seems to fix cluster schema propagation issues in urchin-dtest. I
can now run TestSimpleCluster.simple_create_insert_select_test without
any additional delays inserted into the test code.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
* seastar c09488e...6f1dd3c (3):
> net: make udp send more robust wrt. errors
> net: remove packet constructors with template Deleter parameter
> memory: Support for discovering allocator's address range
We also need to encode the event type in the response message. Fixes the
following dtest breakage:
cassandra.connection: ERROR: Error decoding response from Cassandra. opcode: 000c; message contents: '\x83\x00\xff\xff\x0c\x00\x00\x00\x17\x00\x07CREATED\x00\x08KEYSPACE\x00\x02ks'
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/cassandra/connection.py", line 431, in process_msg
flags, opcode, body, self.decompressor)
File "/usr/lib64/python2.7/site-packages/cassandra/protocol.py", line 123, in decode_response
msg = msg_class.recv_body(body, protocol_version, user_type_map)
File "/usr/lib64/python2.7/site-packages/cassandra/protocol.py", line 803, in recv_body
raise NotSupportedError('Unknown event type %r' % event_type)
NotSupportedError: Unknown event type u'CREATED'
Reported-by: Shlomi Livne <shlomi@cloudius-systems.com>
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>