Commit Graph

6393 Commits

Author SHA1 Message Date
Tomasz Grabiec
7fb0806ba2 tests: Add missing include to sstable_test.hh
Broken by 320ff132f8.
2015-09-09 12:36:00 +02:00
Tomasz Grabiec
882f231ef2 database: Move sstable_range_wrapping_reader to sstable_mutation_readers.hh
Fixes compilation problem in memtable.cc. Should be part of the series
committed in b96018411b
2015-09-09 12:03:06 +02:00
Avi Kivity
e5c46420bd Merge "Unimplemented API method to return error." from Amnon
"This series modify the stub implementation of unimplemented API method to
return a 500 Http error.

It does so by adding a new API exception unimplemented_exception and a helper
function unimplemented that throw that exception.

A call to unimplemented was added to each of the stub API methods.

After this series a call to an unimplemented to API would return a 500."
2015-09-09 12:53:21 +03:00
Gleb Natapov
e08160b1ec storage_proxy: do not report disconnects as errors
Connection drop during read operation is not an error and should not be
reported as such. Furthermore disconnects are already reported by
gossip, so no need to report it for each ongoing read again.

Fixes #320
2015-09-09 12:37:52 +03:00
Avi Kivity
6ccb0b15b5 Merge "Move the API configuration from command line to configuration" from Amnon
"It moves the API configuration from the command line argument to the general
config, it also move the api-doc directory to be configurable instead of hard
coded."
2015-09-09 12:35:03 +03:00
Takuya ASADA
e42382a9d5 dist: add mock to RPM build prerequisites
fixes #313.

Signed-off-by: Takuya ASADA <syuu@cloudius-systems.com>
2015-09-09 12:30:21 +03:00
Calle Wilund
be420f1108 Log: write logger name + message to stdout in same call
Fixes #319 - Interleaved logger names/messages from 1+ shards
(Does not do anything to guarantee atomicity of std::cout write itself though)
2015-09-09 12:29:55 +03:00
Avi Kivity
b96018411b Merge "Fix flush in the middle of scanning bug" from Tomasz
Fixes #309.

Conflicts:
	sstables/sstables.cc
2015-09-09 11:56:04 +03:00
Avi Kivity
e2d474ea56 Merge "Enabling the nodetool info" from Amnon
"This series enable the nodetool info, by completing the missing APIs.

The main change is returning fixed value for storage_service
is_rpc_server_running, is_native_transport_running and get_exception_count.

After this series it will be possible to run:
nodetool info (while the jmx is runnning) and to get the results without errors
or crashes."
2015-09-09 11:40:06 +03:00
Tomasz Grabiec
b2c2eb6cd2 tests: Add test exploiting flush while scanning issue 2015-09-09 10:38:43 +02:00
Tomasz Grabiec
b5845e96e5 tests: Fix liveness issue in mutation_test 2015-09-09 10:38:43 +02:00
Raphael S. Carvalho
73695f80c4 fix compaction when a bucket grows beyond max threshold
Size-tiered compaction strategy works by creating buckets with sstables
of similar size, but if a bucket's size is greater than max_threshold
(defined in schema), it will not be selected for compaction.
Scenario described by issue 298 is facing that. If compaction takes a
long time to finish, more than max_threshold sstables will be created,
and thus there wouldn't be a 'valid' bucket for compaction.
Solution is to not add a sstable for a bucket that reached its limit,
so that bucket will have a chance to be compacted.

Fixes issue #298.

Signed-off-by: Raphael S. Carvalho <raphaelsc@cloudius-systems.com>
2015-09-09 11:21:58 +03:00
Tomasz Grabiec
a0c180ef49 memtable: Fix flush in the middle of scanning bug
Fixes #309.

When scanning memtable readers detect is was flushed, which means that
it started to be moved to cache, they fall back to reading from
memtable's sstable.

Eventually what we should do is to combine memtable and cache contents
so that as long as data is not evicted we won't do IO. We do not
support scanning in cache yet though, so there is no point in doing
this now, and it is not trivial.
2015-09-09 10:17:35 +02:00
Tomasz Grabiec
e0d81351fe range: Introduce split_after() 2015-09-09 10:08:24 +02:00
Tomasz Grabiec
320ff132f8 sstables: Relax header dependencies 2015-09-09 10:07:43 +02:00
Tomasz Grabiec
61d9158c0d sstables/hyperloglog: Rename VERSION to version
This fixes a mysterious compilation problem which popped up after
changing header order. It could be that the name "VERSION" picks up
some macro, but I haven't really figured that exactly.
2015-09-09 10:07:07 +02:00
Avi Kivity
5bbe526738 Merge sstable deletion
Deleting sstables is tricky, since they can be shared across shards.

This patchset introduces an sstable deletion agreement table, that records
the agreement of shards to delete an sstable.  Sstables are only deleted
after all shards have agreed.

With this, we can change core count across boots.

Fixes #53.
2015-09-09 11:01:13 +03:00
Gleb Natapov
df468504b6 schema_table: convert code to use distributed<storage_proxy> instead of storage_proxy&
All database code was converted to is when storage_proxy was made
distributed, but then new code was written to use storage_proxy& again.
Passing distributed<> object is safer since it can be passed between
shards safely. There was a patch to fix one such case yesterday, I found
one more while converting.
2015-09-09 10:19:30 +03:00
Calle Wilund
ee2a479731 CQL Test Env: Fixup for test shutdown errors caused by shutdown patch
Refs #293

Even more horrible that the shutdown patch. Tests using cql_test_env
are dependant on init.cc functions, but then scylla stopped being shut down
properly, those tests did to -> assert in sharded.hh

Yet another temp patch, simply duplicating the init.cc code for clq_test_env
to ensure we get what we think.
2015-09-09 10:15:11 +03:00
Amnon Heiman
037dfdcf35 API: add get_load implementation to storage_service
Because of the different implementation the right way of getting the
load (which is the sum of all the live diskspace used) is using the
column_family api and not through the storage_service API.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-09 09:37:37 +03:00
Amnon Heiman
ea5fa7e469 storage_service: return values for exception, native_transport and
rpc_server

This patch changes the behaviour of is_native_transport_running and
is_rpc_server_running to return true and not to fail, we assume that
they are running. It should be changed when an API to start and stop
them will be added.

The get_exception_count will return 0, the definition for it in origin
is exception that were not cought in a thread.

We should re-think about what it means in our implementation, meanwhile
return 0, for no exception, is a reasonable approach.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-09 09:37:18 +03:00
Amnon Heiman
6c2454e8f9 API: Expose the get_cf_stats in column_family
Some APIs other then the column_family need to use the get_cf_stats,
this adds the helper method decleration to the column_family.hh and
change the implementation decleration to be non-static

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-09 03:57:40 +03:00
Amnon Heiman
fe9f7b4d04 API: Call unimplemented for stub API methods that are stubed
The API contains stub API methods, this adds a call to unimplemented
method in each of the stubed method that is not implemented.

The return remains the same to help the compiler deduce the return type
of the lambda function.

After this patch a call to an unimplemented API function will return
500.

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
2015-09-08 19:14:30 +03:00
Avi Kivity
8405aa1c95 Merge "Add decimal type" from Paweł
"These patches add support for decimal type.

Fixes #146."
2015-09-08 19:03:37 +03:00
Paweł Dziepak
a791e230b9 types: drop outdated comments and disabled code
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:37:29 +02:00
Paweł Dziepak
e1d4acdcf6 tests/cql: add decimal type to all types test
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:37:24 +02:00
Paweł Dziepak
8cae940d07 tests/types: add tests for decimal type
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:04:48 +02:00
Paweł Dziepak
39c29a3fb4 types: add decimal type
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:04:48 +02:00
Paweł Dziepak
026ecdb50f utils: add big_decimal class
Signed-off-by: Paweł Dziepak <pdziepak@cloudius-systems.com>
2015-09-08 16:04:30 +02:00
Calle Wilund
d46a95242a Config: Fix type where alias destination was copied instead of referenced
Fixes #310

Missing '&'.
(And no, cannot make the type non-copyable, since we want to copy config
 objects).
2015-09-08 16:54:04 +03:00
Avi Kivity
3a8ca8912b sstables: fix shared sstable deletion
If an sstable is shared, we can't just go ahead and remove it, because
other shards may still be using it; we need their agreement.

Since each shard will have its own sstable object for the same sstable,
we can't use the sstable class as a synchronization point.  Instead,
use a static unordered map indexed by the TOC file name.
2015-09-08 16:46:16 +03:00
Avi Kivity
b76d7db432 db: mark newly created sstables as unshared
Other shards know nothing about them, so they won't mark them for deletion
when the time comes.
2015-09-08 16:45:28 +03:00
Avi Kivity
851248e263 sstables: add a safe deletion function
Switch destructor to use this.

Add an sstable deletion function that is independent of the sstable class,
and so can be used on different shards.
2015-09-08 16:45:26 +03:00
Avi Kivity
1a90d8659f Merge "Shutdown workarounds" from Calle
"Refs #293

* Disables all normal service shutdowns.
* Calls "stop()" explicitly for database (which in turn will also flush
  commitlog etc). Then just does a hard "_exit".
* Add shutdown() + gate to commitlog to prevent data from being added once
  system shutdown is initiated. Will and does cause exceptions in write
  paths during shutdown.

This is an explicitly asked for workaround series for the interdependency
issues making shutdown as formulated by at_exit + sharded::stop unreliable
right now.
Proper ways of doing this would be to
a.) Make services actually stop service when asked to (stop())
b.) Do shutdown in two steps; stop() and later delete.

Note: I've left the old "at_exit" calls commented in main.cc/init.cc as a
reminder that this is not a final solution."
2015-09-08 15:27:31 +03:00
Tomasz Grabiec
3b7dfbcc85 Fix whitespace errors 2015-09-08 14:10:56 +02: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
Avi Kivity
d590e327c0 large_bitmap: support for loading and saving the bitmap to raw ints
Single-bit accessors are very slow, especially because we don't support
setting a bit to a value (just set to 1 and clear to 0).  This causes
loading and retrieving the contents of a bitmap to be painfully slow.

Fix by providing iterator-based load() and save() methods.  The methods
support partial load/save so that access to very large bitmaps can be
split over multiple tasks.
2015-09-08 14:09:59 +02:00
Avi Kivity
089ac79e39 sstables: add sstable::marked_for_deletion()
Accesses previous sstable::mark_for_deletion() setting
2015-09-08 14:53:51 +03:00
Avi Kivity
65c5bf6b64 sstables: make sstable::is_shared() useful
Back it by a variable, and allow setting it.
2015-09-08 14:53:51 +03:00
Avi Kivity
93579287da sstables: add sstable::toc_filename()
Useful for when we want to later access an sstable without instantiating
the heavyweight sstable class.
2015-09-08 14:53:51 +03:00
Avi Kivity
e1c7209258 sstables: make sstable::filename() const 2015-09-08 14:53:51 +03:00
Tomasz Grabiec
b4835756fd tests: Fix compilation error
Introdued in 920fe4278a
2015-09-08 12:52:30 +02:00
Calle Wilund
1004e090f8 Database: Use commitlog::shutdown to help making shutdown more coherent
Should more or less mean that data in sstables + stuff in CL is the
actual DB state.
2015-09-08 11:55:21 +02:00
Calle Wilund
456246dfd5 Commitlog: Add a gate + shutdown method
* Gate ensures we don't add data into a segment after close
* Shutdown closes all segments for business and prohibits new segments
2015-09-08 11:53:41 +02:00
Calle Wilund
d666c747e3 Commitlog: Just add some more verbosity 2015-09-08 11:16:38 +02:00
Calle Wilund
945d2f73b3 Main: Do not actually stop any services on exit.
* Issue the "stop" method on DB (flushed CL + tables (partially))
* Do hard exit (_exit) to escape destructors and sanity checks.

This patch is horrible but sort of a workaround for various interdepdency
shutdown issues. Until services can actually be turned off, this might be
a viable option.

Refs #293. I will not call it a fix.
2015-09-08 11:13:34 +02:00
Tomasz Grabiec
d52853c4fe database: Restore indentation 2015-09-08 10:19:19 +02:00
Tomasz Grabiec
c623fbe1f7 database: Keep sstable as lw_shared_ptr<> from the beginning
Allows us to save on indentation, and we need it as shared anyway later.
2015-09-08 10:19:19 +02:00
Tomasz Grabiec
820a50a36e db: Move FIXME to a more appropriate place
From column_family's point of view, calling write_components() is all
it needs. The FIXME belongs more to an implementation of
write_components().
2015-09-08 10:19:19 +02:00
Tomasz Grabiec
ecf4841953 Fix typo in 'attempt' 2015-09-08 10:19:19 +02:00