Commit graph

90 commits

Author SHA1 Message Date
martinsumner
8a5ed1e198 Confirm skip on unknowns when compacting journal 2017-03-14 17:26:39 +00:00
martinsumner
5311a157d5 Merge remote-tracking branch 'refs/remotes/origin/mas-sstblock-i42' into mas-sstblockv2-i42 2017-03-13 19:22:41 +00:00
martinsumner
c787e0cd78 Handle corrupted Ledger Key when applying recovery strategy
Otherwise may blow up in journal_compaction_bustedjournal test
2017-03-13 14:32:46 +00:00
martinsumner
b2f3d882a9 Draft of branch to condense range_only keys 2017-03-10 20:43:37 +00:00
martinsumner
a9101e4781 SibCount must be non-zero 2017-02-26 22:45:20 +00:00
martinsumner
90c920fe86 Additional unit test work
Reverts a previous ct test fix
2017-01-23 15:15:40 +00:00
martinsumner
76bdd83346 Manifest refactor - STILL BROKEN
Some working tests now, but sitll broken
2017-01-14 16:36:05 +00:00
martinsumner
5a88565c08 Switch to binary index in pmem
Remove the ets index in pmem and use a binary index instead.  This may
be slower, but avoids the bulk upload to ets, and means that matches
know of position (so only skiplists with a match need be tried).

Also stops the discrepancy between snapshots and non-snapshots - as
previously the snapshots were always slowed by not having access to the
ETS table.
2017-01-05 21:58:33 +00:00
martinsumner
2f8ff640a9 Test coverage
Add some furthe runit tests to improve test coverage
2017-01-04 21:36:59 +00:00
martinsumner
060ce2e263 Add put timing points 2016-12-20 23:11:50 +00:00
martinsumner
299e8e6de3 Initial phash test
phash does not appear to be a potential causer of delay
2016-12-20 20:55:56 +00:00
martinsumner
9e28287231 Resolve failing recovery test
Now passing consistently with a number of different corruptions catered
for (including corruption of the Tag in the Inker Key)
2016-12-16 23:18:55 +00:00
martinsumner
f4e2e274e0 Reintroduce riak metadata extraction
The full riak metadata had been stripped from the Ledger update for
performance reasons.  However, the full metadata is required in order to
save a GET before a PUT.  Therefore we want to do isolated testing on
this change to establish the relative cost value in that cost saving.
2016-12-14 10:27:11 +00:00
martinsumner
4b48ed14c6 Correct Mistyped 2 ^ 32 2016-12-11 20:38:20 +00:00
martinsumner
1b63845050 Bring compression back to SFT
It is expensive on the CPU - but it leads to a 4 x increase in the cache
coverage.

Try and make some small micro gains in list handling in create_block
2016-12-11 15:02:33 +00:00
martinsumner
44cee5a6e8 Experiemnt with no compression
Does compression hurt CPU more than the benefit gaine din some cases?
2016-12-11 12:33:09 +00:00
martinsumner
32ac305c67 Compaction test error
Compaction tests now throwing up different corruption points
2016-12-11 06:53:25 +00:00
martinsumner
2d3a40e6f1 Magic Hash - and no L0 Index
Move to using the DJ Bernstein Magic Hash consistently, and trying to
make sure we only hash once for each operation (as the hash is more
expensive than phash2).

The improved lookup time for missing keys should allow for the L0 index
to be removed, and hence speed up the completion time for push_mem
operations.

It is expected there will be a second stage of creating a tinybloom as
part of the SFT creation process, and then adding that tinybloom to the
manifest.  This will then reduce the message passing required for a GET
not in the cache or higher levels
2016-12-11 01:02:56 +00:00
martinsumner
5bdb7fd7fa Alter Riak HEAD
Change the extract of Riak metadata.

In Riak-based volume tests hte writing of SFT files is tanking.  Could
this be the "extra" metadata.  i.e. There are only current plans to look
at the vclock.  Sibling count is free to fetch, what if we just get
these two items, will it be less CPU to extract the metadata, but also
will the reduced weight reduce the downstream impact?
2016-12-08 23:38:50 +00:00
martinsumner
e8c1d39df9 Switch to binary format Riak object
Initial change to try and test assuming that leveled received the binary
format of Riak objects (and parses that for metadata).
2016-11-28 22:26:09 +00:00
martinsumner
6684e8e1d3 Refine query to accept fold functions
Need to be able to pass external fold functions into different queries,
to work as a Riak backend
2016-11-18 15:53:22 +00:00
martinsumner
7147ec0470 Logging - Phase 1
Abstract out logging and introduce a logbase
2016-11-02 18:14:46 +00:00
martinsumner
84a92b5f95 Further testing of compaction
Check we avoid crashing in challenging compaction scenarios
2016-11-01 00:46:14 +00:00
martinsumner
7d3a04428b Refactor snapshot
Better reuse snapshotting fucntions in the Bookie, and use it to support
doing Inker clone checks
2016-10-31 17:26:28 +00:00
martinsumner
bd6c44e9b0 Correct is_active
Firts part of adding support for scanning for Keys and Hashes.  as part
of this discovered TTL support did the opposite (only fetched things in
the past!).
2016-10-31 16:02:32 +00:00
martinsumner
3b05874b8a Add initial timestamp support
Covered only by basic unit test at present.
2016-10-31 12:12:06 +00:00
martinsumner
a00a123817 Recovery strategy testing
Test added for the "retain" recovery strategy.  This strategy makes sure
a full history of index changes is made so that if the Ledger is wiped
out, the Ledger cna be fully rebuilt from the Journal.

This exposed two journal compaction problems

- The BestRun selected did not have the source files correctly sorted in
order before compaction
-  The compaction process incorrectly dealt with the KeyDelta object
left after a compaction - i.e. compacting twice the same key caused that
key history to be lost.

These issues have now been corrected.
2016-10-27 00:57:19 +01:00
martinsumner
2a47acc758 Rolback hash|no_hash and batch journal compaction
The no_hash option in CDB files became too hard to manage, in particular
the need to scan the whole file to find the last_key rather than cheat
and use the index.  It has been removed for now.

The writing to the journal during journal compaction has now been
enhanced by a mput option on the CDB file write - so it can write each
batch as one pwrite operation.
2016-10-26 11:39:27 +01:00
martinsumner
97087a6b2b Work on reload strategies
Further work on variable reload srategies wiht some unit test coverage.
Also work on potentially supporting no_hash on PUT to journal files for
objects which will never be directly fetched.
2016-10-25 23:13:14 +01:00
martinsumner
c78b5bca7d Basement Tombstones
Further progress towards the tidying up of basement tombstones in the
Ledger, with support added for key-listing to help with testing (and as
a potentially required feature).

The test is incomplete, but committing at this stage as the last commit
broke some tests (within the test code).

There are some outstanding questions about the handling of tombstones in
the Journal during compaction.  There exists a condition whereby values
could return if a recent journal is compacted and tombstones are removed
(as they are no longer present), but older journals have not been
compacted.  Now on stop/start - if the Ledger is wiped the removal of
the keys will be forgotten but the original PUTs would still remain.

The safest thing maybe to have rule that tombstones are never deleted
from the Inker's Journal - and accept the build-up of garbage.  Or there
could be an addition to the compaction process that checks back through
all the inker files to check that the Key of a tombstone is not present
in the past, before it is removed in the compaction.
2016-10-23 22:45:43 +01:00
martinsumner
e9c568a8b3 Test fix-up
There was a test that failed to close down a bookie and that caused some
issues.  The issues are double-reoslved, the close down was tidied as
well as the forgotten close being added back in.

There is some generla tidy around in anticipation of TTL support.
2016-10-21 21:26:28 +01:00
martinsumner
0a2053b557 Improved unit test of CRC chekcing in bloom filter
Confirm the impact of bit-flipping in the bloom filter
2016-10-21 16:08:41 +01:00
martinsumner
7319b8f415 Redundant clauses
Remove some redundant clauses, and fix up some logging
2016-10-19 20:51:30 +01:00
martinsumner
12fe1d01bd Penciller Manifest and Locking
The penciller had the concept of a manifest_lock - but it wasn't clear
what the purpose of it was.

The updating of the manifest has now been updated to reduce the code and
make the process cleaner and more obvious.  Now the committed manifest
only covers non-L0 levels.  A clerk can work concurrently on a manifest
change whilst the Penciller is accepting a new L0 file.

On startup the manifets is opened as well as any L0 file.  There is a
possible race condition with killing process where there may be a L0
file which is merged but undeleted - and this is believed to be inert.

There is some outstanding work still.  Currently the whole store is
paused if a push_mem is received by the Penciller, and the writing of a
L0 sft file has not been completed.  The creation of a L0 file appears
to take about 300ms, so if the ledger_cache fills in this period a pause
will occurr (perhaps due to objects with lots of index entries).  It
would be preferable to pause more elegantly in this situation.  Perhaps
there should be a harsh timeout on the call to check the SFT complete,
and catching it should cause a refused response.  The next PUT will then
wait, but a any queued GETs can progress.
2016-10-19 17:34:58 +01:00
martinsumner
8f29a6c40f Complete 2i work - some refactoring
The 2i work now has tests for removals as well as regex etc.

Some initial refactoring work has also been tried - to try and take some
tasks of the critical path of push_mem.  The primary change has been to
avoid putting index keys into the gb_tree, and building the KeyChanges
list in parallel to the gb_tree (now known as ObjectTree) within the
Ledger Cache.

Some initial experiments done as to changing the ETS table in the
Penciller now that it will now be used for iterating - but that has been
reverted for now.
2016-10-18 19:41:33 +01:00
martinsumner
3e475f46e8 Support for 2i query part1
Added basic support for 2i query.  This involved some refactoring of the
test code to share functions between suites.

There is sill a need for a Part 2 as no tests currently cover removal of
index entries.
2016-10-18 01:59:18 +01:00
martinsumner
e3ce372f31 Delete
Add functionality to delete keys.  No tombstone reaping yet.
2016-10-16 15:41:09 +01:00
martinsumner
ed17e44f52 Improve test coverage
Some additional tests following previous refactoring for abstraction,
primarily to make manifest print safer an dprove co-existence of Riak
and non-Riak objects.
2016-10-14 22:58:01 +01:00
martinsumner
7eb5a16899 Supporting Tags - Improving abstraction between Riak and non-Riak workloads
The object tag "o" which was taken from eleveldb has been an extended to
allow for specific functions to be triggered for different object types,
in particular when extracting metadata for stroing in the Ledger.

There is now a riak tag (o_rkv@v1), and in theory other tags can be
added and used, as long as their is an appropriate set of functions in
the leveled_codec.
2016-10-14 18:43:16 +01:00
martinsumner
bbdac65f8d Split out key codec
Aplit out key codec, and also saner approach to key comparison (although
still awkward).
2016-10-13 21:02:15 +01:00