Commit graph

1104 commits

Author SHA1 Message Date
Martin Sumner
c8552d5bd5 Add exports required by kn_index_tictactree 2018-03-28 14:01:40 +01:00
Martin Sumner
e0d63209a1 Export merge binaries
For use by processes wanting to merge roots or branches
2018-03-26 09:39:34 +01:00
Martin Sumner
c1cd00b498 Allow ignore non-binary subkey for hash
This allows the subkey to be an integer, that will be gnored for hashing purposes
2018-03-22 22:07:24 +00:00
Martin Sumner
b81caf7dee segment_hash -> tictac
the concept of the segment hash belongs to the leveled_tictac module, not the codec.

Previously the alignment of tictac and store was accidental, this change makes it explicit.
2018-03-22 19:03:52 +00:00
Martin Sumner
6ce903ad2b Change segment_hahs for HEAD
Needs toaling with ?RIAK tag, and so that AAE key-ordered and segment-ordered stores also agree on definition of Segment ID
2018-03-22 17:12:58 +00:00
Martin Sumner
cda412508a IsEmpty check
Previously there was no is_empty check, and there was a workaround using binary_bucketlist.  But what if there were many buckets - this is a slow seek (using get next key over and over).

Instead have a proper is_empty check.
2018-03-21 15:31:00 +00:00
Martin Sumner
ef22aabe85 Alter comment 2018-03-20 11:11:41 +00:00
Martin Sumner
096f49bb1d Add missing comment 2018-03-19 11:40:49 +00:00
Russell Brown
d487c1bc51 Fix failing test, I don't understand how
See #122 for details
2018-03-15 11:09:28 +00:00
Martin Sumner
25be7ef535 Change TicTac tree sizing
Previously TicTac trees were of equal width at both levels.  This seemed reasonably efficient way of sclaing up key sizes (e.g. at each increment both level widths doubled giving a 4 x increase in size).

However if we're to do comparisons with fetch_root followed by fetch_branches this might not be as efficient.  As with a 1024 x 1024 tree a 1000 deltas requires the whole tree to eb exchanged, where as with a 4096 * 256 tree a 1000 deltas only requires a quarter of the tree to be sent over the network.

The whole tree, with a 4 byte hash size is 4MB in this case - requiring 30ms of network time on a Gbps link. There may be longer blocking of inter-node communication on LFNs (as per the tests in Meiklejohn's Partisan paper - https://arxiv.org/abs/1802.02652).

This  changes makes TicTac tree tests run slower.  But perhaps this is a price worth paying for smoothing out the potential impact on inter-node communication?
2018-03-14 10:36:17 +00:00
Martin Sumner
a9a20c9150 Smoother temrinate on destroy
don't try and terminate a dead process
2018-03-07 16:20:41 +00:00
Martin Sumner
e29743310d Make destroy "normal"
Put the special actions in the handle_call not the terminate
2018-03-07 16:14:50 +00:00
Martin Sumner
4bf6d3e73d Fiddle with naming in query API
Was easier in the calling applictaion to switch between using and not using a list of the Query format was consistent between those two cases.
2018-03-02 10:20:43 +00:00
Martin Sumner
5312806592 Stop Iterator re-use
The IMM iterator should not be reused, as it has already been filtered for a query.  so if reused for a different query incorrect and unexpected results may occur.

This reuse had been stopped by a previous commit, and this cleans up subsequently unused code.
2018-03-02 08:16:34 +00:00
Martin Sumner
d21d18dd82 Remove rogue log 2018-03-01 23:37:05 +00:00
Martin Sumner
861aa5a7db Support multi-query fold
Allow a single snapshot to run query over multiple ranges.   Used initially to fold over multiple buckets.
2018-03-01 23:19:52 +00:00
Martin Sumner
fa532fbd27 Tidy set_status 2018-02-16 20:56:12 +00:00
Martin Sumner
090e414b23 Coverage issues
Not making proxy object so get_size not required.

Extend tests to improve coverage
2018-02-16 20:27:49 +00:00
Martin Sumner
70dfb77088 Optional lookup in head_only mode
Allow decision to be made on startup whether ObjectSpecs can be looked up directly when running in head_only mode.
2018-02-16 17:06:30 +00:00
Martin Sumner
910ccb6072 Add lookup support in head_only mode
Originally had disabled the ability to lookup individual values when running in head_only mode.  This is a saving of about 11% at PUT time (about 3 microseconds  per PUT) on a macbook.

Not sure this saving is sufficient enought to justify the extra work if this is used as an AAE Keystore with Bitcask and LWW (when we need to lookup the current value before adjusting).

So reverted to re-adding support for HEAD requests with these keys.
2018-02-16 14:16:28 +00:00
Martin Sumner
2b6281b2b5 Initial head_only features
Initial commit to add head_only mode to leveled.  This allows leveled to receive batches of object changes, but where those objects exist only in the Penciller's Ledger (once they have been persisted within the Ledger).

The aim is to reduce significantly the cost of compaction.  Also, the objects ar enot directly accessible (they can only be accessed through folds).  Again this makes life easier during merging in the LSM trees (as no bloom filters have to be created).
2018-02-15 16:14:46 +00:00
Martin Sumner
834704a3ff Merge branch 'mas-i117-factor4scale' of https://github.com/martinsumner/leveled into mas-i117-factor4scale 2018-02-10 08:10:32 +00:00
Martin Sumner
f748fc8611 Narrower still
Make the LSM tree more bottle shaped.

Experiment to judge performance impact
2018-02-10 08:10:24 +00:00
Martin Sumner
5673d8b558 Expand test to ensure coverage catch 2018-02-10 08:09:33 +00:00
Martin Sumner
8113aebdcf Add timings for Level 3
Level 3 readings now relatively common - so time the separately
2018-02-09 08:59:21 +00:00
Martin Sumner
c7cea04aba Correct maximum length 2018-02-08 15:31:35 +00:00
Martin Sumner
7e4c3db915 Alternate scale factor
Also had failed unit test - there was an issue with bit-flipping the position not being safely caught
2018-02-08 10:29:27 +00:00
Martin Sumner
bb39498ec5 Missed log line added back
.. and covered in test
2017-12-04 15:26:01 +00:00
Martin Sumner
f8ceedc9bb Compress L0 only
Doing at L1 has a negative impact as tests draw on.  Also improve head time tracking
2017-12-04 10:49:42 +00:00
Martin Sumner
1f5d5033a4 Revert "Revert "Disable compression L0 and L1""
This reverts commit 958d3f5e14.
2017-12-04 09:30:27 +00:00
Martin Sumner
958d3f5e14 Revert "Disable compression L0 and L1"
This reverts commit b10c0cf895.
2017-12-04 09:29:44 +00:00
Martin Sumner
b10c0cf895 Disable compression L0 and L1 2017-12-02 09:19:17 +00:00
Martin Sumner
6e589942b6 Cover bit flips in the slot header 2017-12-01 16:20:48 +00:00
Martin Sumner
5bac389d0c Switch to CRC check at Block Level
Previously done at Slot Level - but Blocks were still read from disk after the Slot CRC had been checked.

This seems safer.  It requires an extra CRC check for every fetch.  However, CRC chekcing smaller binaries during the buld process appears to be beneficial to performance.

Hoped this will be an enabler to turning off compression at Levels 0 and 1 to improve performance (wihtout having a compensating issues with reduced CRC performance)
2017-12-01 14:15:13 +00:00
Martin Sumner
7a99d060a3 Resolve OTP 19 compatibility
Dialyzer issues otherwise
2017-11-30 19:10:26 +00:00
Martin Sumner
9d9ad17d36 Typo 2017-11-30 16:29:10 +00:00
Martin Sumner
3b42bc28d1 Add build timing info to merge_list log
Help to determine what the expensive part of the operation is
2017-11-30 16:15:38 +00:00
Martin Sumner
41c308c5fd As used in lookup - will always be hash 2017-11-28 22:13:18 +00:00
Martin Sumner
eb90541a85 Add a small cache to SST file
so that a HEAD which folllows a HEAD (e.g. when a GET follows a HEAD) has a chance of avoiding the binary_to_term CPU load
2017-11-28 14:56:40 +00:00
Martin Sumner
7c4e1a5ad9 Typo 2017-11-28 11:49:50 +00:00
Martin Sumner
a655baf881 Resolve R16 dialyzer issue 2017-11-28 11:49:29 +00:00
Martin Sumner
5342e3a94f Improve testing of bloom feature
In particular will blooms re-appear following startup
2017-11-28 11:43:46 +00:00
Martin Sumner
c2f19d8825 Switch to using bloom at penciller
Previouslythe tinybloom was used within the SST file as an extra check to remove false fetches.

However the SST already has a low FPR check in the slot_index.  If the newebloom was used (which is no longer per slot, but per sst), this can be shared with the penciller and then the penciller could use it and avoid the message pass.

the message pass may be blocked by a 2i query or a slot fetch request for a merge.  So this should make performance within the Penciller snappier.

This is as a result of taking sst_timings within a volume test - where there was an average of + 100microsecs for each level that was dropped down.  Given the bloom/slot checks were < 20 microsecs - there seems to be some further delay.

The bloom is a binary of > 64 bytes - so passing it around should not require a copy.
2017-11-28 01:19:30 +00:00
Martin Sumner
467ad50cd1 Settle on hash approach 2017-11-27 15:29:01 +00:00
Martin Sumner
6b222ea8f9 Revert "Revert "Switch to 32 slots""
This reverts commit 99dad0c86f.
2017-11-27 15:17:40 +00:00
Martin Sumner
99dad0c86f Revert "Switch to 32 slots"
This reverts commit 7af6a3ba00.
2017-11-27 15:16:18 +00:00
Martin Sumner
7af6a3ba00 Switch to 32 slots 2017-11-27 15:16:10 +00:00
Martin Sumner
5e6541dddb Revert "Revert "Half size of each slot's bloom""
This reverts commit d37c5eab3f.
2017-11-27 14:51:25 +00:00
Martin Sumner
34dc63a8f8 Change measurement 2017-11-27 14:51:03 +00:00
Martin Sumner
d37c5eab3f Revert "Half size of each slot's bloom"
This reverts commit d83eea7c60.
2017-11-27 14:49:43 +00:00