Commit graph

295 commits

Author SHA1 Message Date
Martin Sumner
8c4de27789 Fix spec for book_hotbackup/1
Returned function requires a backup path
2021-11-10 10:52:19 +00:00
Martin Sumner
82cc76c8c6 Tidy up some undefined functions in dialyzer specs (#368) 2021-11-05 09:16:34 +00:00
Martin Sumner
70ebb62a61 Search the loader's mock cache .. (#354)
... in the correct direction - otherwise frequently updated objects may not be indexed correctly on reload.
2021-10-04 13:34:29 +01:00
Martin Sumner
4ec8d3e25c Commit selective_sync 2021-10-01 01:51:59 +01:00
Martin Sumner
4ec9d14019 Expose 8 arity-put
Required for selective sync
2021-09-30 22:10:19 +01:00
Martin Sumner
507bf63e22
Address issue with comment (#349)
https://github.com/martinsumner/leveled/issues/269
2021-08-10 13:11:09 +01:00
Martin Sumner
ed0301e2cf
Mas i335 otp24 (#336)
* Address OTP24 warnings, ct and eunit paths

* Reorg to add OTP 24 support

* Update VOLUME.md

* Correct broken refs

* Update README.md

* CI on all main branches

Co-authored-by: Ulf Wiger <ulf@wiger.net>
2021-05-25 13:41:20 +01:00
Martin Sumner
b4c79caf7a Allow for caching of compaction scores
Potentially reduce the overheads of scoring each file on every run.

The change also alters the default thresholds for compaction to favour longer runs (which will tend towards greater storage efficiency).
2020-11-27 02:35:27 +00:00
Martin Sumner
e175948378 Remove references ot 'skip' strategy
Now called `recovr`
2020-03-26 14:25:09 +00:00
Martin Sumner
20a7a22571 Add documentation for recalc option 2020-03-24 20:21:44 +00:00
Martin Sumner
9d92ca0773 Add tests for appDefined functions 2020-03-16 12:51:14 +00:00
Martin Sumner
694d2c39f8 Support for recalc
Initial test included for running with recallc, and also transition from retain to recalc.

Moves all logic for startup fold into leveled_bookie - avoid the Inker requiring any direct knowledge about implementation of the Penciller.
2020-03-15 22:14:42 +00:00
Martin Sumner
156e7b064d Compaction, retain and recovery
Change the penciller check so that it returns current/replaced/missing not just true/false.

Reduce unnecessary penciller checks for non-standard keys that will always be retained - and remove redunandt code.

Expand tests of retain and recover to make sure that compaction on delete is well covered.

Also move the SQN number laong during initial loads - to stop aggressive loop to find starting SQN every file.
2020-03-09 15:12:48 +00:00
Martin Sumner
d5c1d1e51e Log about cache ratio and object hit ratio
If not a snapshot.
2019-08-29 17:48:46 +01:00
Martin Sumner
ecda13872a Add logging of cache ratio
Two reasons for logging this:

- to assist in sizing the ledger cache;
- to resolve the mystery when there appear to be no fetches from the penciller (as the penciller does not report fetches from the ledger cache)
2019-08-29 11:26:29 +01:00
Martin Sumner
57d73fc548 Make page cache level configurable 2019-07-25 12:23:10 +01:00
Martin Sumner
e7c8dd7a78 Typo round-up
Also reduce log noise when persisting new Journal files
2019-07-25 10:24:40 +01:00
Martin Sumner
dab9652f6c Add ability to control journal size by object count
This helps when there are files wiht large numbers of key deltas (and hence small values), where otherwise the object count may get out of control.
2019-07-25 09:45:23 +01:00
Martin Sumner
7862a6c523 Change page cache loading by lookup/no_lookup
By default load the first 4 levels of the ledger into the page cache of lookup is to be supported, but just levels 0 and 1 otherwise.
2019-07-18 14:00:19 +01:00
Martin Sumner
952f088873 Memory management
Extracting binary from within a binary leaves a reference to the whole of the original binary.

If there are a lot of very large objects received abck toback - this can explode the amount of memory the penciller appears to hold (and gc cannot resolve this).

To dereference from the larger binary, need to do a binary copy
2019-06-15 17:23:06 +01:00
Martin Sumner
b5859ddde9 Change default DB ID
An undefined database id will use 65536 not 0 (as 0 is commonly used when defining database ids in Riak)
2019-06-14 11:19:37 +01:00
Martin Sumner
876a023db1 Add database_id to options
So that this can be recorded in logs
2019-06-13 14:58:32 +01:00
Martin Sumner
d30fb0ee33 Reduce frequency of timing logs
and record level in the sst timing logs
2019-05-11 15:59:42 +01:00
Martin Sumner
486af59da1 Soften log noise 2019-05-11 13:26:07 +01:00
Martin Sumner
01f0dadbb3 Add access to SQN
Use book_sqn/3 or book_sqn/4 to get the SQN of an object in the store.
2019-03-13 16:21:03 +00:00
Martin Sumner
fd2e0e870c Align cache with default
Stop L0 from growing too large i.e. 127 * 4K is more than 10 times bigger than the default.
2019-02-25 23:35:12 +00:00
Martin Sumner
db1486fa36 Check SQN order fold does not fold beyond end of snapshot
the Journla snapshot is not a true snapshot, in that the active file in the snapshot can still be taking appends.  So when getting a snapshot it is necessary to check if folding over the snapshot that the SQN is <= JournalSQN when the snapshot is taken.

Normally consistency of the snapshot is managed as the operation depends on the penciller, and the penciller *is* a snapshot.  Not in this case, as the penciller will return true on a sqn check if the pcl SQN is behind the Journal.  So the Journal folder, has been given an additionla check to stop at the JournalSQN.

This is perhaps a fault in the pcl check sqn, which should only return true on an exact match?  I'm nervous about changing this though, so we have a less pure fix for now.
2019-02-14 21:14:11 +00:00
Martin Sumner
1776220148 Log and coverage tidy
These logs duplicate information being received from other logs, so reduced to debug.

The long running test needs to change with the LONG_RUNNING macro
2019-02-14 15:20:54 +00:00
Martin Sumner
31badfd601 Log rationalisation and format improvements 2019-02-13 13:06:28 +00:00
Martin Sumner
ae9b03ab3c Fix unit tests - and make slot size configurable 2019-01-26 16:57:25 +00:00
Martin Sumner
f7022627e5 Check not pending before compacting
Also check for existence before deleting a CDB file
2019-01-25 19:11:34 +00:00
Martin Sumner
00a59f4f8f
Merge branch 'mas-qc-inkercompaction' into mas-i249-iclerkshutdown 2019-01-25 09:53:56 +00:00
Martin Sumner
28d0aef5fe Make check that compaction not ongoing before accepting new compaction
Respond 'busy' if compaction is ongoing
2019-01-24 15:46:17 +00:00
Martin Sumner
a13a6ae45f Updated model
This has inappropriate default parameter changes.
2019-01-22 12:53:31 +00:00
Martin Sumner
7f08fd5a68 Change file references in unit tests
Write into test folder within the repo, not outside of it.  Try and resolve issues wiht make test in riak
2019-01-17 21:02:29 +00:00
Martin Sumner
a4d89ad6d1 Add log of higher than expected ratio of cache sizes
Warn at startup if this ratio is high.  Not sure how snapshots will perform if there are a lot of ledger cache sin the list.  However, it should still work.  basic_SUITE/load_count test intended to demonstrate that a large ratio is still functional
2019-01-14 16:11:04 +00:00
Martin Sumner
2741c46daa Add timeout for inker snapshots
So that they can also be released if they silently crash without closing neatly.
2018-12-14 13:53:36 +00:00
Martin Sumner
8bf36214e1 Make snapshot timeout configurable
Also increase defaults.  In riak snapshots may be used to fold over all objects, and with delays at the receiving end, this could take significant time
2018-12-14 11:23:04 +00:00
Martin Sumner
672cfd4fcd Allow for run-time changes to log_level and forced_logs
Will not lead to immediate run time changes in SST or CDB logs.  These log settings will only change once the new files are re-written.

To completely change the log level - a restart of the store is necessary with new startup options.
2018-12-11 21:59:57 +00:00
Martin Sumner
6677f2e5c6 Push log update through to cdb/sst
Using the cdb_options and sst_options records
2018-12-11 20:42:00 +00:00
Martin Sumner
90574122c9 Merge remote-tracking branch 'aeternity/uw-avoid-set_env' into mas-pr231-review 2018-12-10 18:33:23 +00:00
Ulf Wiger
d30ca16a17 store log opts in pdict + inherit at proc start 2018-12-10 16:09:11 +01:00
Martin Sumner
e73f48a18b Add failing test
Test fails as fetching repeated object is too slow.

```Head check took 124301 microseconds checking list of length 5000

Head check took 112286 microseconds checking list of length 5000

Head check took 1336512 microseconds checking list of length 5

2018-12-10T11:54:41.342 B0013 <0.2459.0> Long running task took 260788 microseconds with task of type pcl_head

2018-12-10T11:54:41.618 B0013 <0.2459.0> Long running task took 276508 microseconds with task of type pcl_head

2018-12-10T11:54:41.894 B0013 <0.2459.0> Long running task took 275225 microseconds with task of type pcl_head

2018-12-10T11:54:42.173 B0013 <0.2459.0> Long running task took 278836 microseconds with task of type pcl_head

2018-12-10T11:54:42.477 B0013 <0.2459.0> Long running task took 304524 microseconds with task of type pcl_head```

It taks twice as long to check for one repeated object as it does to check for 5K non-repeated objects
2018-12-10 11:58:21 +00:00
Martin Sumner
714e128df8 Tidy up protecting against corrupt Keys
this was previously not na issue as leveled_codec:segment_hash/1 would handle anyhting that could be hashed.  This now has to be a tuple, and one with a first element - so corrupted tuples are failing.

Add a guard chekcing for a corrupted tuple, but we only need this when doing journal compaction.

Change user_defined keys to be `retain` as a tag strategy
2018-12-07 09:07:22 +00:00
Martin Sumner
e0352414f2 iClerk refactor
the skip/retain/recalc handlign was confusing.  This removes the switcheroo between leveled_codec and leveled_iclerk when mkaing the decision.

Also now the building of the accumulator is handled efficiently (not using ++ on the list).

Tried to rmeove as much of ?HEAD tag handling from leveled_head - as we want leveled_head to be only concerned with the head manipulation for object tags (?STD, ?RIAK and user-defined).
2018-12-06 22:45:05 +00:00
Martin Sumner
8e687ee7c8 Add user-defined functions
To allow for extraction of metadata, and building of head responses - it should eb possible to dynamically and user-defined tags, and functions to treat them.

If no function is defined, revert to the behaviour of the ?STD tag.
2018-12-06 21:00:59 +00:00
Martin Sumner
881b93229b Isolate better changes needed to support changes to metadata extraction
More obvious how to extend the code as it is all in one module.

Also add a new field to the standard object metadata tuple that may hold in the future other object metadata base don user-defined functions.
2018-12-06 15:31:11 +00:00
Martin Sumner
835955adb9 Deprecate use of Bucket as a constraint in indexfold
Must also give a StartKey.  Otherwise there may be conflict when tuplebuckets are used
2018-12-05 20:46:17 +00:00
Martin Sumner
9735661d98 Typos as per PR comments 2018-12-05 09:31:03 +00:00
Martin Sumner
578a9f88e0 Support for log settings at startup
Both log level and forced_logs.  Allows for log_level to be changed at startup ad runtime.  Also allow for a list of forced logs, so if log_level is set > info, individual info logs can be forced to be seen (such as to see stats logs).
2018-12-05 00:17:39 +00:00