Commit graph

1298 commits

Author SHA1 Message Date
Martin Sumner
174a40aab2 Tidy up unexported types
also re:mp may not be exported in R16
2018-11-05 16:02:19 +00:00
Martin Sumner
d3c9104336
Merge pull request #201 from martinsumner/mas-i189-tuplebuckets-take2
Mas i189 tuplebuckets take2
2018-11-05 12:22:36 +00:00
Martin Sumner
e9fb893ea0 Check segment is as expected with tuplebuckets
In head_only mode
2018-11-05 10:31:15 +00:00
Martin Sumner
e72a946f43 TupleBuckets in Riak objects
Adds support with test for tuplebuckets in Riak keys.

This exposed that there was no filter using the seglist on the in-mmemory keys.  This means that if there is no filter applied in the fold_function, many false positives may emerge.

This is probably not a big performance benefit (and indeed for performance it may be better to apply during the leveled_pmem:merge_trees).

Some thought still required as to what is more likely to contribute to future bugs: an extra location using the hash matching found in leveled_sst, or the extra results in the query.
2018-11-05 01:21:08 +00:00
Martin Sumner
37cdb22979
Merge pull request #200 from martinsumner/mas-i198-recentaae
Mas i198 recentaae
2018-11-04 20:51:13 +00:00
Martin Sumner
4b8f493fd6 Allow compariosn with empty binaries
If trees are non-existent, then fetch_root may return an empty binary (in tictac aae) - still need to compare
2018-11-02 17:34:58 +00:00
Martin Sumner
2eec8a5378 MaxCount monitoring and responding
Stop issue of {no_more_keys, Acc} being passed on fold over list of ranges to next range (and blowing up)
2018-11-01 23:40:28 +00:00
Martin Sumner
dc84eabe0c Revert "Temp log"
This reverts commit 2b57ff831c.
2018-11-01 20:16:08 +00:00
Martin Sumner
c126872fab Revert "More temp logs"
This reverts commit 7e959f1353.
2018-11-01 20:16:04 +00:00
Martin Sumner
7e959f1353 More temp logs 2018-11-01 20:04:22 +00:00
Martin Sumner
2b57ff831c Temp log 2018-11-01 19:58:32 +00:00
Martin Sumner
71fa1447e0 Allow for all keys head folds to used modifed range
This helps with kv_index_tictcatree with the leveled_so backend.  Now this cna do folds over ranges of keys with modified filters (as folds over ranges of keys must go over lal keys if the backend is segment_ordered)
2018-11-01 17:30:18 +00:00
Martin Sumner
aa123a80a7 Allow for backwards/forwards compatibility in specs 2018-11-01 12:40:24 +00:00
Martin Sumner
acd5db779a Merge branch 'master' into mas-i198-recentaae 2018-11-01 10:59:05 +00:00
Martin Sumner
8e752ce93c
Merge pull request #199 from martinsumner/mas-i196-expandseglist
Mas i196 expandseglist
2018-11-01 10:52:29 +00:00
Martin Sumner
f77dc8c3a5 Add object_spec type
Initial refactor to prepare to allow for a new version object_spec type that will support LMD being promoted as an accessible item.
2018-11-01 10:41:46 +00:00
Martin Sumner
376407fa66 Extend testing
In particular discover that after objects are modifed (outside of the LMD window) - they no longer appear in results for queries in the LMD window.
2018-10-31 21:37:53 +00:00
Martin Sumner
62f1302305 Add test comparing filter with non-filter
How do timings differ - does the SST filter accelerate?  The answer appears to be yes - the filtered version takes half the time.
2018-10-31 18:34:27 +00:00
Martin Sumner
19bfe48564 Initial ct test
Which exposed it wasn't working.  If there is no segment list passed - just a modification filter, you don't need to check the position list (as checking the position list returns an empty position so sipping all the matching results!)
2018-10-31 16:35:53 +00:00
Martin Sumner
aaccd09a98 Allow for setting max_keys to wrap Acc
Acc in response is now of form {Reason, Acc} not just Acc so that the application can understand the reason for the results ending - and take appropriate action (e.g. restart again from the LastKey to return more results).
2018-10-31 14:22:28 +00:00
Martin Sumner
142e3a17bb Add in modifictaion date to v2 value
And restrict it to 32 bits - as 80 years should be enough.
2018-10-31 11:44:46 +00:00
Martin Sumner
f0208e9b12 Fix issues with deprecated folders
They were deprecated for a reason
2018-10-31 11:04:23 +00:00
Martin Sumner
11627bbdd9 Extend API
To support max_keys and the last modified date range.

This applies the last modified date check on all ledger folds.  This is hard to avoid, but ultimately a very low cost.

The limit on the number of heads to fold, is the limit based on passing to the accumulator - not on the limit being added to the accumulator.  So if the FoldFun perfoms a filter (e.g. for the preflist), then those filtered results will still count towards the maximum.

There needs to be someway at the end of signalling from the fold if the outcome was  or was not 'constrained' by max_keys - as the fold cannot simply tel by lenght checking the outcome.

Note this is used rather than length checking the buffer and throwing a 'stop_fold' message when the limit is reached.  The choice is made for simplicity, and ease of testing.  The throw mechanism is necessary if there is a need to stop parallel folds across the the cluster - but in this case the node_worker_pool will be used.
2018-10-31 00:09:24 +00:00
Martin Sumner
1f976948a1 Add test timeout
As timed out with coverage enabled
2018-10-30 21:52:17 +00:00
Martin Sumner
ffe4c39ee8 Add tests with old file format 2018-10-30 21:43:49 +00:00
Martin Sumner
ae1ada86b2 Add accumulator check for last mod range
Perhaps should also do the segment check at this point.  Seems odd to check last modified date and segments in different places.
2018-10-30 19:35:29 +00:00
Martin Sumner
b7e697f7f0 Fold API to leveled_sst
Externally to leveled_sst all folds are actually managed through exapnd_list_by_pointer.

Make the API a bit clearer in this regards, and add specs to help dialyzer.

This also adds LowLastMod to the API for expanding pointers (although the leveled_penciller just defaults this to 0 for everything.
2018-10-30 16:44:00 +00:00
Martin Sumner
bdd1762130 Missing use of extract_header
Spotted by ct test crossbucket_aae
2018-10-30 14:06:17 +00:00
Martin Sumner
75d2e2d546 Fix yield
Wrong format of repsonse if was delete_pending
2018-10-30 13:00:23 +00:00
Martin Sumner
7295a41321 Read (and ignore) last modified date
Add presence of LMD into index - and check everything happily lets it pass by
2018-10-30 11:47:03 +00:00
Martin Sumner
467c2fb89c Allow a boolean to be passed in to set IndexModDate
Although we are still pre-release in Leveled, for completeness it is a useful test of this code change to show that it can be done in a backwards compatible way.

So a boolean is added to indicate whether a file should index the modified date within the slot, and this can then be read when the file is opened.

Nothing happens with the boolean, yet.
2018-10-30 10:25:54 +00:00
Martin Sumner
8ba28700eb Start adding in last_moified dates
With updated specs
2018-10-29 21:50:32 +00:00
Martin Sumner
14fd67e535 Add specs and comments and split function
Need to change this, so refactor and make neater in preparation
2018-10-29 21:16:38 +00:00
Martin Sumner
baa4466923 Remove knowledge of tuple length from ledger value
Nothing should now care about the current tuple length - and hence the tuple length may be increased (for example to add a max_mod_date)
2018-10-29 20:24:54 +00:00
Martin Sumner
671b6e7f99 Strip ALL_BUCKET - only used in AAE 2018-10-29 16:56:58 +00:00
Martin Sumner
2e2c35fe1b Extract deprecated recent_aae
Ready to add other forms of last modified filtering
2018-10-29 15:49:50 +00:00
Martin Sumner
3803a190af No need to test at high volume every run 2018-10-24 16:01:41 +01:00
Martin Sumner
f4c65597ea log 2 compat
Need to support math:log2 in early versions of OTP (for Riak)
2018-10-24 15:42:21 +01:00
Martin Sumner
6d62803567 Test at higher volume
Increase probability of hit
2018-10-24 12:06:42 +01:00
Martin Sumner
d171fda705 Format comment 2018-10-24 11:58:25 +01:00
Martin Sumner
d5d54cc13a Add timing test to guide selection of approach 2018-10-24 11:50:36 +01:00
Martin Sumner
4981cdfc07 Expand segment lists when matches are produced form smaller trees
Let us say a store has precalculated segments based on large tree size, but mismatched segmentIDs are found on a small tree size (for query efficiency).

the list of segment IDs need to be expanded out for matching.  This may be more efficient that running match_segment for each check (expand out once and uses lists:member/2).  Also this is necessary for leveled_so AAE stores (segment-ordered stores)
2018-10-24 10:19:54 +01:00
Martin Sumner
5cbda7c2f7
Merge pull request #197 from martinsumner/mas-i196-segfilter
Add segment matching function
2018-10-24 07:34:14 +01:00
Martin Sumner
dd9a6f0015 Add segment matching function
For when matching between different tree sizes
2018-10-23 18:46:10 +01:00
Martin Sumner
5f5255142d
Merge pull request #195 from martinsumner/mas-i194-startupsqn
Mas i194 startupsqn
2018-10-03 21:05:57 +01:00
Martin Sumner
0bbaf1f25e Handle missing journal files without data loss
Make sure data added after the journal has been lost will not be lost (even though lost data may stay lost)
2018-10-03 18:38:56 +01:00
Martin Sumner
9a0082db4e Test to expose startup issue
See #194
2018-10-03 18:29:20 +01:00
Martin Sumner
cc676190c4
Merge pull request #193 from martinsumner/mas-192-journalcheck4head
Mas 192 journalcheck4head
2018-10-01 11:59:41 +01:00
Martin Sumner
b7c8304d99 Never check inker if head_only 2018-09-28 16:58:28 +01:00
Martin Sumner
b1ae7837a1 Add unit test of frequency
but a bit hard to test due to randomness
2018-09-28 16:16:19 +01:00