Commit Graph

114 Commits

Author SHA1 Message Date
Avi Kivity
548646d4ba Merge branch 'master' of github.com:cloudius-systems/seastar into db
Should fix use-after-free when a frozen_mutation is applied to the
local shard.

Includes two adjustments to urchin collectd usage from Calle:

  - Updated thrift collectd registration to use proper move semantics
  - Commitlog: Fix collectd registration to use move semantics + test

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-12 14:47:07 +03:00
Calle Wilund
183e0b52e6 commitlog: Add collectd counters
- # segments
- # allocting segments
- # unused segments
- # allocations
- # cycles (disk writes)
- # flush
- # total bytes allocated
- # total bytes disk slack (due to dma blocks)

Counters are per-commitlog (shard). Can be extended to be per-segment also,
but would be transient and probably not much more useful.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-11 16:06:51 +03:00
Calle Wilund
46e0676a7d commitlog: Add reader stream/subscription
Generic read-all-stream from a commit log segmen file.
Provides a byte view for each data entry, doing CRC checks and padding skips.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-06 16:45:13 +03:00
Calle Wilund
7f685abca0 commitlog: added file header space twice
Checked wrong var == 0 when creating second mem buffer in segment

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-06 16:19:56 +03:00
Calle Wilund
897083e213 commitlog: Sync check time delta was inverted
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-06 16:19:49 +03:00
Calle Wilund
d2d3547115 commitlog: Initial data chunk offset should be 16
As in "after file header".

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-06 16:19:43 +03:00
Pekka Enberg
9920d58b70 db/commitlog: Use C++ type aliases
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2015-05-06 09:43:04 +03:00
Calle Wilund
e1c0ddea93 commitlog: make sure we don't race creating segments
Use a semaphore as gatekeeper to make sure we finish creating a segment
before starting a new one.

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-05-05 09:59:27 +03:00
Calle Wilund
2f4e7a00f6 Use db/config object in main, database etc
* Uses config object to augument/impl options parsing
* Database now holds config obj
* Commitlog can now be inited with global config obj.
2015-04-29 18:01:17 +02:00
Calle Wilund
aeb83f2874 Add commitlog to db + use it in storage_proxy/handler
* A commitlog is created in "work" dirs when initing the db
  from a datadir. However, since we have neither disk data storage,
  nor replay capability yet (and no real db config), the settings 
  are basically to just write in-memory serialization, write them to 
  disk and then discard them. So in fact, pointless. But at least using
  the log...
* Moved the actual "apply" of mutation into database. If a commitlog
  is active, add an entry to it before applying mutation.
2015-04-29 10:10:21 +02:00
Calle Wilund
07f1208926 Make commitlog respect max disk size setting. 2015-04-29 10:10:21 +02:00
Calle Wilund
9979ee8d45 Modify commit log to use dataoutput
Both internal usage and external interface.
2015-04-01 10:08:00 +02:00
Calle Wilund
80b244cc4b commitlog: fix using wrong segment
Commit log segment "finish_and_get_new" should not call "new_segment"
explicitly, since more than one invocation might get there on the same
flush condition (segment full).

Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-03-09 17:54:47 +02:00
Calle Wilund
054f9ed082 Initial commit log support.
Implements a cassandra-file-compatible segmented log
of "mutations". Handles "batch" and "periodic" mode like
stock version. Also includes "dirty" management for the
interaction log/memtable.

Supports:
* add
* sync/flush
* clear dirty bits (thus discarding segments)

Many more estoric stock functions not yet implemented.

Missing: Storage management. Does not deal with total
size on disk of segments yet. Nor does it have any provisions
for dealing with active buffer bloat should async writes stall.

[avi: adjust for future<>::rescue() removal]
Signed-off-by: Calle Wilund <calle@cloudius-systems.com>
2015-03-05 11:06:09 +02:00