Commit graph

178 commits

Author SHA1 Message Date
martinsumner
cd82bba6cd Use cache size - don't recalc length 2017-03-06 21:44:20 +00:00
martinsumner
9ad6969b0d Seed randomnes at Actor startup 2017-03-06 21:35:02 +00:00
martinsumner
87f2c5d7ae Merge remote-tracking branch 'origin/mas-2iphase2-i34' into mas-2iphase2-i34
# Conflicts:
#	src/leveled_log.erl
2017-03-06 18:44:22 +00:00
martinsumner
c92107e4b4 2i order of events
When running a load of mainly 2i queries, there is a huge cost in the
previous snapshot code.  The time taken to create a clone of the
Penciller (duplicating all the LoopState) varied between 1 and 200ms
depedning on the size of the LoopState.

For 2i queries, most of that LoopState was then being thrown away after
running the query against the levelzero_cache.  This was taking < 1ms on
average.  It would be better to avoid the o(100)ms of CPU  burning and
block for o(1)ms - so th eorder of events have been changed ot filter
first so only the small part of the LoopState actually required is
copied to the clone.
2017-03-06 18:42:32 +00:00
Martin Sumner
c1dc92720c Random, random, random
well random had me foxed.  As the clone was short-lived process it only
called random once - and so always got the same answer.

random has to be seeded to give different answers when called once from
a process - so this is now seeded in leveed_log
2017-03-06 13:51:38 +00:00
martinsumner
eb6f668fcd Use log at random
Easy way to sample frequent things - especially when they'r ein ocverag
equeries
2017-03-06 10:34:56 +00:00
martinsumner
5c2f05858d Alter logging to help understand performance factors
Change logging of the snapshots to better understand performance
2017-03-06 10:17:51 +00:00
martinsumner
b01f7d23df Add pre-filter for 2i queries 2017-03-02 17:49:43 +00:00
martinsumner
35b6e16590 Clear dialyzer warnings 2017-02-27 20:23:36 +00:00
martinsumner
4e6c22d7e6 Dumb test
Can't test for slow not_present outside of simple unit test ... will be
very rare event
2017-02-26 21:48:04 +00:00
martinsumner
41e5686a66 Test coverage - missing 1% 2017-02-26 20:52:40 +00:00
martinsumner
793977b76c Prevent double work ongoing
This was the cause of the pclerk crash.  The concurrent work would lead
to the attempt to re-fetch the prompted deletions after they had been
deleted.
2017-02-09 23:41:28 +00:00
martinsumner
ed96d0ca7a Change so that type of cache is parameterised
The Tree doesn't seem to be better than the skiplist.  Get ready to make
this switchable
2017-01-21 11:38:26 +00:00
martinsumner
3d99036093 Switch the LM1 cache to be a tree
Use a tree of lists not a skiplist
2017-01-20 16:36:20 +00:00
martinsumner
7086717765 Rename to pmanifest
There may be a seperate imanifest in the future
2017-01-17 14:11:50 +00:00
martinsumner
c99c50ce6e Fix-up message exchange on confirm delete 2017-01-17 11:18:58 +00:00
martinsumner
9832ecc369 Manifest now back to a simple list
This has refactored code with the implementation of the manifest
isolated in to a seperate module, and the pure async relationship
between penciller and their clerk.  However, the manifest is just a
simple list at each level.
2017-01-17 10:12:15 +00:00
Martin Sumner
f868be8086 Change Penciller to Clerk handoff
correct the previous change to make sure that deletes are not confirmed
when work is outstanding, but also make sure that the clerk only ever
casts the Penciller so no deadlocks can ensue.
2017-01-15 00:52:43 +00:00
martinsumner
0c01a90f96 Manifest SQN at startup
An L0 file outside the Manifest will be written at a Manifest SQN one
higher - so need to look at stratup for one at one higher
2017-01-14 22:31:45 +00:00
martinsumner
7b0b3e9b83 Add logging of Manifest SQN at startup 2017-01-14 22:26:26 +00:00
martinsumner
ea171cb13b Attempt to stop race - between level zero and ongoing merge 2017-01-14 22:03:57 +00:00
martinsumner
8f0a096dd2 More work on timeout 2017-01-14 20:57:43 +00:00
martinsumner
86af99e511 Set timeout correctly 2017-01-14 20:19:08 +00:00
martinsumner
13c81f0ed1 Basic working
Some basic tests working - but still outstanding issues.
2017-01-14 19:41:09 +00:00
martinsumner
76bdd83346 Manifest refactor - STILL BROKEN
Some working tests now, but sitll broken
2017-01-14 16:36:05 +00:00
martinsumner
0204a23a58 Refactor - STILL BROKEN
Will at least compile, but in need of a massive eunit rewrite and
associated debug to get back to a potentially verifiable state again
2017-01-13 18:23:57 +00:00
martinsumner
08641e05cf Manifest changes - BROKEN
Going to abandond this branch for now.  The change is beoming
excessively time consuming, and it is not clear that a smaller change
might not achieve more of the objectives.

All this is broken - but perhaps could get picke dup another day.
2017-01-12 13:48:43 +00:00
martinsumner
83be8041f0 Update comments to reflect changes 2017-01-06 10:09:15 +00:00
martinsumner
5a88565c08 Switch to binary index in pmem
Remove the ets index in pmem and use a binary index instead.  This may
be slower, but avoids the bulk upload to ets, and means that matches
know of position (so only skiplists with a match need be tried).

Also stops the discrepancy between snapshots and non-snapshots - as
previously the snapshots were always slowed by not having access to the
ETS table.
2017-01-05 21:58:33 +00:00
martinsumner
e6270d288f Half-way to ets for Bookie mem
A half-way implementation with use of ETS as the bookie's memory
2017-01-05 17:00:12 +00:00
martinsumner
2f8ff640a9 Test coverage
Add some furthe runit tests to improve test coverage
2017-01-04 21:36:59 +00:00
martinsumner
afb28aa7d6 Switch iterator scan width to macro
And 4 seems a more reasonable number than 1
2016-12-29 10:21:57 +00:00
martinsumner
c3999110e2 Remove io:format from debugging 2016-12-29 02:47:21 +00:00
Martin Sumner
18f2b5660d Fix to ensure directory structure created 2016-12-29 02:31:10 +00:00
martinsumner
dc28388c76 Removed SFT
Now moved over to SST on this branch
2016-12-29 02:07:14 +00:00
Martin Sumner
676e8fa494 Add Get Timing 2016-12-22 15:45:38 +00:00
martinsumner
130fb36ddd Add head timings
Include log breaking down timings of HEAD requests by result and level
2016-12-22 14:03:31 +00:00
martinsumner
b2835aeaec Improve fetching efficiency
Experiment to see if parsing all keys in block can be avoided - and if
so does this make the range scan more efficient.

Unproven change.
2016-12-21 18:28:14 +00:00
martinsumner
be775127e8 Improve logging of merge activity and slow GETs
Look into speculation that collisions between fetch_rnage and fetch may
be an issue
2016-12-21 12:45:27 +00:00
martinsumner
cf6a1eb513 Add extra bloom check
Add extra bloom check - but get the SFT process to perform not the chekc
not the Penciller.  This avoids complexity of negotiating the transfer
of the bloom to the Penciller - but doesn't avoid the potentially
unecessary message pass between processes.
2016-12-12 18:01:37 +00:00
martinsumner
86bdfdeaf0 Reverted back out the additional bloom check
This is desirable to add back in going forward, but wasn't implemented
in a safe or clear way.

The way the bloom was or was not on the LoopState was clumsy, and it got
persisted in multiple places without a CRC check.

Intention to implement back in wherby it is requested on-demand by the
Penciller, and then the SFT worker lifts it off disk and CRC checks it.
So it is never on the SFT LoopState.  Also it will be easier to control
the logic over which levels have the bloom in the Penciller.
2016-12-11 21:01:10 +00:00
martinsumner
6f06c6fdeb ETS delete
Delete the objects rather than starting a new table each time
2016-12-11 07:07:30 +00:00
martinsumner
2758498fad More Jitter!
Having reduced the size of the ledger cache (again) we can now tolerate
more jitter here
2016-12-11 06:54:41 +00:00
martinsumner
8bcb49479d Re-introduce ETS Index
Add ETS Index back in to avoid having to check each skip list in turn.
Also this helps keep a lower skip list size.
2016-12-11 05:23:24 +00:00
martinsumner
f848500eff Tinker, tinker, tinker, tinker 2016-12-11 04:53:36 +00:00
martinsumner
523716e8f2 Add tiny bloom to Penciller Manifest
This is an attempt to save on unnecessary message transfers, and
slightly more expensive GCS checks in the SFT file itself.
2016-12-11 04:48:50 +00:00
martinsumner
ea8f3c07a7 oops 2016-12-11 02:00:19 +00:00
martinsumner
2c7fdc74d4 Setting fiddling
Try to find a happy medium
2016-12-11 01:58:25 +00:00
martinsumner
5d11bc051f Allow for more fluctuation in L0 write time
Try to alleviate existing co-ordination issue when all vnodes tend to
try and write L0 files concurrently
2016-12-11 01:49:03 +00:00
martinsumner
2d3a40e6f1 Magic Hash - and no L0 Index
Move to using the DJ Bernstein Magic Hash consistently, and trying to
make sure we only hash once for each operation (as the hash is more
expensive than phash2).

The improved lookup time for missing keys should allow for the L0 index
to be removed, and hence speed up the completion time for push_mem
operations.

It is expected there will be a second stage of creating a tinybloom as
part of the SFT creation process, and then adding that tinybloom to the
manifest.  This will then reduce the message passing required for a GET
not in the cache or higher levels
2016-12-11 01:02:56 +00:00