Commit graph

1115 commits

Author SHA1 Message Date
Martin Sumner
0b0fde2f23 Resolve Issue 243 2019-02-13 11:10:56 +00:00
Martin Sumner
509d541c9f Allow for false to close not crash
If PID has gone away
2019-01-29 13:46:25 +00:00
Martin Sumner
51a0260a60 Get new file to check initiater is alive
If no activity within timeout.  Make sure that the process has been orphaned by pclerk ending before manifest entry update made.
2019-01-29 13:18:39 +00:00
Martin Sumner
e5a5da35eb Level Zero constructor to get close
Allows for the L0 constructor to be closed (even though not yet in the manifest) on shutdown
2019-01-29 13:06:00 +00:00
Martin Sumner
ae9b03ab3c Fix unit tests - and make slot size configurable 2019-01-26 16:57:25 +00:00
Martin Sumner
f907fb5c97 Close in all cases
in leveled_imanifest
2019-01-25 19:27:42 +00:00
Martin Sumner
a04ed53855 Merge branch 'mas-qc-inkercompaction' of https://github.com/martinsumner/leveled into mas-qc-inkercompaction 2019-01-25 19:11:37 +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
c9a955f2dd
Merge branch 'mas-qc-inkercompaction' into mas-i249-iclerkfsm 2019-01-25 15:15:29 +00:00
Martin Sumner
5b54affbf0 Have inker reopen compacted files
The inker cler will now close compacted files before prompting the inker to update the manifest.  The inker should reopen those files, so that the file processes are linked to it and not the clerk.

This also stops a stopped clerk leading to orphaned cdb files.
2019-01-25 14:32:41 +00:00
Martin Sumner
e349774167 Allow clerk to be stopped during compaction scoring
This will stop needless compaction work from being completed when the iclerk is sent a close at this stage.
2019-01-25 12:11:42 +00:00
Martin Sumner
00a59f4f8f
Merge branch 'mas-qc-inkercompaction' into mas-i249-iclerkshutdown 2019-01-25 09:53:56 +00:00
Martin Sumner
0333604fd9 Change to cast in inker/iclerk interaction
This allows for leveled_iclerk:clerk_stop to be a sync call, so that files will only be closed once the iclerk has stopped.  This is designed ot prevent iclerk crashes during shutdowns when files it is depnding on are closed mid shutdown.
2019-01-24 21:32:54 +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
c9bf43953b Expect TS in snapshot references from manifest
Add type to prevent re-occurence.  This is also detected by failure in eqc tests.
2019-01-24 14:32:01 +00:00
Martin Sumner
a13a6ae45f Updated model
This has inappropriate default parameter changes.
2019-01-22 12:53:31 +00:00
Martin Sumner
b713ce60a8 Initial eqc setup 2019-01-21 10:51:07 +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
86128ddf56 Remove pointless test
Was testing a test admin function for coverage reasons
2019-01-17 11:30:50 +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
c060c0e41d Handle L0 cache being full
A test thta will cause leveled to crash due to a low cache size being set - but protect against this (as well as the general scenario of the cache being full).

There could be a potential case where a L0 file present (post pending) without work backlog being set.  In this case we want to roll the level zero to memory, but don't accept the cache update if the L0 cache is already full.
2019-01-14 12:27:51 +00:00
Martin Sumner
e77451f60b Creating the file is unnecessary 2018-12-18 16:26:48 +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
7a876066e2 Resolve coverage gaps
logs should always at least have a log_level defined which is in the ?LOG_LEVELS - so the final case of

`-is_active_level([]   , _, _) -> false.`

is unnecessary (even if a bad log level is passed in).

correct Bucket and Key definition to hit expected eunit test cases in leveled_pmem
2018-12-11 22:25:37 +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
9ca6b499e1 Remove use of string rather than straddle OTP version
string functions were used in unit tetss only, and were replaceable with io_lib:format
2018-12-11 15:44:37 +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
b38d845c3a Update src/leveled_pmem.erl
Simple change to check for presence of objetc in list before adding it:

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

Head check took 130114 microseconds checking list of length 5000

Check for presence of repeated objects

Head check took 1725 microseconds checking list of length 5```
2018-12-10 12:01:11 +00: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
4b4b774c0d Fix dialyzer warnings
Dialyzer got smarter in OTP 21 and spotted that the output type was wrong from tune_seglist
2018-12-07 14:36:18 +00:00
Martin Sumner
bb0d088aae
Update leveled.app.src
Switch release reference
2018-12-07 12:50:24 +00:00
Martin Sumner
1fc73f9092 Update src/leveled.app.src 2018-12-07 12:26:41 +00:00
Martin Sumner
019a7a02e9 Update src/leveled.app.src 2018-12-07 12:26:11 +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
Ulf Wiger
fbe200f1ca warning-free vsns of string:str/2 & string:right/3 2018-12-07 08:39:44 +01:00
Martin Sumner
cee5a60ceb Protect against bad journal keys in Ledger 2018-12-07 00:48:42 +00:00
Martin Sumner
3ff51c000c Typo 2018-12-06 22:55:00 +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
150fcf15d6
Merge pull request #217 from martinsumner/mas-i216-nomod
Remove incorrect mod entry
2018-12-05 09:31:57 +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
Martin Sumner
968be4c4be Remove incorrect mod entry 2018-12-04 20:15:29 +00:00
Ulf Wiger
88c233f911 dynamically check log_level 2018-11-30 10:38:03 +01:00
Martin Sumner
a9aa23bc9c Bucket list
update the docs to advertise throw capability.  Test it for bucket list (and fix ordering of bucket lists)
2018-11-23 18:56:30 +00:00