Commit graph

1100 commits

Author SHA1 Message Date
Martin Sumner
ca2b857e36 Add replace segment function
This will be useful in kv_index_tictactree to do partial rebuilds after fetch_clock requests
2018-05-24 16:12:12 +01:00
Martin Sumner
274b1f5c6d Export types from leveled_tictac 2018-05-19 11:09:03 +01:00
Martin Sumner
afa9ddecd2 Merge branch 'mas-i31-cdccrckey' of https://github.com/martinsumner/leveled into mas-i31-cdccrckey 2018-05-18 15:48:39 +01:00
Martin Sumner
b8a642fd35 Spec update 2018-05-18 15:48:36 +01:00
Martin Sumner
8011a9cde1 Unit test should not pass with bad key
Unit test needed to capture a bad key scenario, which did not get returned false.  However, bad keys are now CRC checked and so willalways return false - and so the case clause for bad key can be dropped.
2018-05-18 15:23:43 +01:00
Martin Sumner
039b135f5f Ease timeout pressure in unit test 2018-05-18 14:36:47 +01:00
Martin Sumner
5e95e6a6b3 correct incorrect return value
required by leveled_codec:compact_inkerkvc/2
2018-05-18 13:44:51 +01:00
Martin Sumner
d468dd32a8 More consistency in extract value functions
Try to make this a little bit cleaner and more obvious.  Make sure the value passed is always a value and not a crc/value.
2018-05-18 13:29:19 +01:00
Martin Sumner
7cc5512a0a safe_read
There are now two cases of safe_read_next_key/2

the first case using the original function name will return just the Key when positive (not the Key and KeyBinary).  If the Key and KeyBinary is required (e.g. for CRC checking purposes), then use safe_read_next_keyint/2.
2018-05-18 11:49:19 +01:00
Martin Sumner
d56ff6efbc Make CRC check cover key and value
So that a corrupted key is detected through a CRC check without crashing leveled (e.g. because it binary_to_term/1 failes somewhere or it is a tuple of the wrong length).

Previously the CRC covered the value only.

Note if you only wish to extract the value, the key cannot be independently validated.  Perhaps a process extrating key only could hit issues.
2018-05-18 11:17:04 +01:00
Martin Sumner
989f23bca6 Add cache population for non-yielding range fetches
More likely to require caching at lower levels.
2018-05-17 16:38:52 +01:00
Martin Sumner
779ccd9c2a Add use of block index when not cached (for fetch range) 2018-05-17 14:56:15 +01:00
Martin Sumner
18aabb49ba Segment filter and multiple keys in slot
An issue was spotted.  If we use a segment filter in a query, and there are multiple matches within a given slot - only the first match is returned.

Tests didn't detect this.  Now they do, and the issue is resolved.
2018-05-16 17:24:23 +01:00
Martin Sumner
cbf6e26fc8 Revert "Accumulate keys in check_blocks"
This reverts commit 5414e18047.
2018-05-16 15:11:18 +01:00
Martin Sumner
5414e18047 Accumulate keys in check_blocks
Previously couldn't accumulate keys using check-blocks - so if a key was found in the first position, and there were other positions to check for other keys, those other positions wouldn't be checked.
2018-05-16 11:38:26 +01:00
Martin Sumner
2cc088fc64 More debug 2018-05-16 11:24:57 +01:00
Martin Sumner
a7cda7213f Debug logs 2018-05-16 11:06:51 +01:00
Martin Sumner
8b4adcccaf Debug logs 2018-05-16 10:51:59 +01:00
Martin Sumner
06fd9856b5 Add debug log 2018-05-16 10:34:47 +01:00
Martin Sumner
3d1c085af3 Revert log additions 2018-05-15 10:41:56 +01:00
Martin Sumner
15a5db5055 Sort tuned seg list 2018-05-15 10:36:07 +01:00
Martin Sumner
6160db3377 Further log 2018-05-15 10:30:09 +01:00
Martin Sumner
1e40648c83 Add initial log 2018-05-15 10:11:37 +01:00
Martin Sumner
eb5950a179 Merge branch 'master' into mas-i134-compileflag 2018-05-04 17:14:21 +01:00
Martin Sumner
96cee2a64c Add specific compile flag to avoid deprecation warning
Will see us through OTP 20 and 21.
2018-05-04 17:14:12 +01:00
Martin Sumner
6a20b2ce66 Use leveled_codec types
... and exporting them.

Previously types wer enot exported, and it appears dialyzer treated tham as any() when they were unexported types ??!!??
2018-05-04 15:24:08 +01:00
Martin Sumner
2063cacd8f More spec/doc work in leveled_codec
Note that at some stage KeyChanges got overloaded to mean {KeyChanges, TTL}, and the spec now tries to make this a bit clearer
2018-05-04 11:19:37 +01:00
Martin Sumner
aa34ffda5b Crash not skip on corrupted key 2018-05-03 20:14:36 +01:00
Martin Sumner
2cd20fcb47 Missed generate_uuid reference 2018-05-03 18:26:02 +01:00
Martin Sumner
f88f511df3 leveled_codec spec/doc
Try and make this code a little bit more organised andd easier to follow
2018-05-03 17:18:13 +01:00
Martin Sumner
416aa7c0d3 Reference startup writeup 2018-05-02 16:03:03 +01:00
Martin Sumner
ef9ac57c5e Add information on startup options 2018-05-02 15:48:16 +01:00
Martin Sumner
a9db4a0082 Spec and comment Inker 2018-05-02 10:57:27 +01:00
Martin Sumner
dd7b753688 Add spec and comments to penciller 2018-05-01 21:28:40 +01:00
Martin Sumner
ee5dc43cfd Add doc/spec to bookie
Improve the comments and dialyzer hints within the bookie.
2018-05-01 12:03:24 +01:00
Martin Sumner
8123e49c7a
Merge pull request #132 from martinsumner/mas-i126-intermittentfailure
Mas i126 intermittentfailure
2018-04-30 20:37:22 +01:00
Martin Sumner
37b067e61b Remove failure detection from eunit test
As it now consistently passes
2018-04-30 17:48:34 +01:00
Martin Sumner
941d4d2577 Fix issue with use of ets:next
ets:next is not StartInclusive - so we shouldn't use ets:next when querying the ledger cache, until it has been confirmed thta a matching key to the StartKey is not present.

This reoslves the intermittently failing unit test which highlighted this (and also makes that intermittent failure a permanent failure by expanding the test cases it covers).
2018-04-30 15:20:37 +01:00
Russell Brown
92582de4dd WIP: changes for backend_eqc test
Enable support for $key and $bucket index
2018-04-12 10:06:29 +01:00
Martin Sumner
6e51cbc853 is_alive not needed
Throwback when this was in terminate.
2018-04-10 12:22:00 +01:00
Martin Sumner
45ec837813 de-terminate cdb 2018-04-10 10:32:52 +01:00
Martin Sumner
293bd8fb78 de-terminate inker 2018-04-10 10:05:46 +01:00
Martin Sumner
bb752f1025 de-terminate bookie 2018-04-10 09:54:35 +01:00
Martin Sumner
11ba7029aa de-terminate penciller 2018-04-10 09:51:21 +01:00
Martin Sumner
54d81220b2 Merge branch 'master' into mas-i115-simplettcache 2018-04-05 09:14:02 +01:00
Martin Sumner
766cee50d7 Expand test for join_segment 2018-04-04 22:37:01 +01:00
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