Commit Graph

46 Commits

Author SHA1 Message Date
negoyal af0b51d684 Misc. 2021-05-09 00:44:07 -07:00
negoyal 84a438b001 Merge branch 'master' into redwood_queue_improvements 2021-05-06 11:32:29 -07:00
negoyal 1467217d5c Merge branch 'master' into redwood_queue_improvements 2021-05-04 23:03:21 -07:00
negoyal 0a5c5a1fb5 Misc bug fixes. 2021-04-28 12:43:22 -07:00
Steve Atherton 5c3cb0da20 Pager now reports whether an uncacheable read hit the cache or not. CommitSubtree now does uncacheable reads so it can avoid copying the old version of the page for modification if it was not already in cache. 2021-04-16 20:13:23 -07:00
Steve Atherton daa1796c99 Added Pager function for trying to evict a page from cache. 2021-04-15 00:08:29 -07:00
negoyal dbbb1bad13 First pass at Extent based queue for redwood remap queue. 2021-04-08 12:47:25 -07:00
Steve Atherton 90ebf90c8b Refactored page rebuild logic to bulk build pages full and split pages more evenly. 2021-04-03 19:54:49 -07:00
David Youngworth e1b7dd0c7d Merge remote-tracking branch 'upstream/release-6.3' into dyoungworth/fixMerge1 2020-08-22 12:25:19 -07:00
Steve Atherton c18d16ad30 Multiple sibling page updates within the remap cleanup window can now avoid the second update step, copying updated contents over the original page, by instead updating the parent page to point to the new sibling locations. 2020-08-09 03:04:38 -07:00
sfc-gh-tclinkenbeard 2a393633b6 Improved const-correctness
Using the recently added IndexedSet::const_iterator
(https://github.com/apple/foundationdb/pull/3185), we can improve the
const-correctness of many functions. In this PR const is added where
applicable. Also, wherever I came across the following while adding
const, I made the following changes:

- virtual function overrides are marked as override
- NULL is replaced with nullptr
- git clang-format is applied
2020-06-17 18:20:43 -07:00
Steve Atherton 1966dbb576 Checkpointing large refactor of how commitSubtree() works regarding internal pages such that now they can be incrementally modified and detecting changes involves far fewer comparison and staging of records. 2020-05-08 07:11:51 -07:00
Steve Atherton dda0993d16 Apply clang-format to Redwood source. 2020-04-24 14:12:40 -07:00
Steve Atherton d4334256f1 Bug fix: BTree::writePages() was not accounting for the small amount of unpredictability in node overhead sizes which could lead to serializing a tree that doesn't fit into its destination page buffer. WritePages() now skips the prefix common to all records in the input set when calling deltaSize() to estimate resulting DeltaTree serialized sizes. 2020-04-08 20:18:41 -07:00
Steve Atherton 5a1884d054 Leaf page modifications are now made incrementally until the DeltaTree is out of space or the tree is too imbalanced, at which point it falls back to a linear merge and page(s) rebuild. 2020-02-21 16:26:44 -08:00
Stephen Atherton 61558eea04 Implemented page preloading on BTree cursor seeks to enable hiding latency on soon-to-be-read sibling pages. Added random scans with various preload sizes to the set performance unit test. ObjectCache now tracks hits, misses, and pages which were preloaded but then never used prior to eviction. BTree pages no longer store flags because height is sufficient. Removed virtual specifier in classes not designed to be further inherited. Removed old prototype code (PrefixTree, IndirectShadowPager, MemoryPager) as some interface changes are incompatible and they are no longer worth maintaining. 2019-11-11 09:54:22 -08:00
Stephen Atherton 4e9c3164a8 COWPager can now internally remap page IDs by version and has been renamed to DWALPager. This causes the B+Tree to no longer have to rewrite all ancestors of an updated page. FIFOQueue now has a read-only cursor and a peekAll() method to read an entire queue without popping it. Fixed some valgrind false positives, made some debug logging improvements. Fixed bug in pager shutdown where it could wait on an ActorCollection containing canceled futures. 2019-11-04 03:04:03 -08:00
Stephen Atherton 0d993522d3 CommitSubtree() will now return an empty page set even for the tree root because commit_impl() handles this correctly. Improved commitSubtree() debug output related to which mutations are relevant to a subtree. Added random setting of range clear boundaries after clear() in Redwood correctness to make sure mutation buffer logic handles this correctly. B+Tree's dbEnd mutation is represented as a clear to prevent unnecessary rightmost subtree traversal during commit. 2019-10-28 04:00:37 -07:00
Stephen Atherton 6a57fab431 Bug fixes in lazy subtree deletion, queue pushFront(), queue flush(), and advancing the oldest pager version. CommitSubtree no longer forces page rewrites due to boundary changes. IPager2 and IVersionedStore now have explicit async init() functions to avoid returning futures from some frequently used functions. 2019-10-22 17:17:29 -07:00
Stephen Atherton 44175e0921 COWPager will no longer expire read Snapshots that are still in use. 2019-10-18 01:27:00 -07:00
Stephen Atherton c3e2bde987 Deferred subtree clears and expiring/reusing old pages is complete. Many bug fixes involving scheduled page freeing, page list queue flushing, and expiring old snapshots (this was mostly written but not used yet). Rewrote most of FIFOQueue (again) to more cleanly handle queue cyclical dependencies caused by having queues that use a pager which in tern uses the same queues for managing page freeing and allocation. Many debug output improvements, including making BTreePageIDs and LogicalPageIDs stringify the same way everywhere to make following a PageID easier. 2019-10-15 03:10:50 -07:00
Stephen Atherton bb280e76db Major refactor primarily to change BTree page ids from a single LogicalPageID to multiple, but also refactored write path data structures and memory lifetimes to use Refs and Arenas and carefully avoid unnecessary copying as it involved much of the same code. Pager reads can now explicitly avoid cache pollution. Refactored toString() helpers for easier debug output using common container types. 2019-09-27 21:46:24 -07:00
Stephen Atherton be37a7c01d Added format versioning to COWPager page, header, BTreePage, BTree meta record. Added height to BTree pages. 2019-09-27 21:46:24 -07:00
Stephen Atherton b19ef86ab9 Pager2 interface now supports getting a read snapshot at a version and setting the oldest readable version. FIFOQueue now supports pushFront() which is needed for the BTree's incremental tree deletion process. 2019-09-27 21:46:24 -07:00
Stephen Atherton f81eeea495 Bug fixes. COWPager initialization was not flushing non-header pages with fsync() before writing and syncing the header. FIFOQueue was writing the initial page of a new queue multiple times. FIFOQueue::writePage() would unnecessarily (and invalidly) attempt to write if the page is not yet loaded. 2019-08-08 02:57:23 -07:00
Stephen Atherton da9c4e97d3 Added new pager interface, IPager2, whose write interface enables forcing the user to handle a page update causing a copy to a new Page ID. Implemented FIFOQueue<T> which uses pages of T stored in a Pager2 instance to implement a FIFO queue. Implemented COWPager, a copy-on-write Pager2 in which all page writes cause a change of Page ID. VersionedBTree, still only operating in single-version mode, now uses Pager2. 2019-08-07 02:36:33 -07:00
Stephen Atherton 0fb8612ef5 debug_printf_noop() was incorrectly defined as a function, which still has a runtime cost of argument evaluation. 2019-05-22 03:40:18 -07:00
Stephen Atherton ebc96a7e0e Merge branch 'master' of github.com:apple/foundationdb into feature-redwood
# Conflicts:
#	fdbserver/VersionedBTree.actor.cpp
2019-05-21 23:49:27 -07:00
Andrew Noyes 13ba915a19 Fix more unused variable warnings 2019-04-17 15:38:08 -07:00
Stephen Atherton 6660ccd936 Large rewrite/refactor from the page format outward. Replaced the in-page format, PrefixTree, with more general and templated implementation of the same concept, DeltaTree, which will be incrementally modifiable soon. New implementation for in-page cursors to use a per-page arena and share decoded binary tree nodes between cursors in the same page. New implementation for internal record B+Tree cursor which uses reference counted path hops which makes cloning a cursor very cheap. New implementation of external facing B+Tree cursor which makes efficient use of two internal cursors to find user-visible KV pairs and return them without copying keys and values except in the case of a large sharded value. 2019-02-21 02:46:30 -08:00
Stephen Atherton 9d73166b3b Many bug fixes related to concurrent page operations and pager shutdown. 2018-11-06 19:31:16 -08:00
Stephen Atherton df3bdde50b Many bug fixes. AsyncFileCached write() on a page with a zero-copy read in progress would orphan the old page before the read was finished. Pager file operations were not converting page id to int64 for byte offset calculation. Pager was not calling releaseZeroCopy() after readZeroCopy() if there was an error or cancellation. Pager reads were using some variables that could go out of scope. BusyPage's mechanism for notifying when a physical page is no longer in use is itself no longer in use and therefore removed. Pager shutdown now cancels all outstanding reads. Improved some debug output. 2018-10-31 02:14:55 -07:00
Stephen Atherton 0e84c1f438 Pager and btree debug output macro now prints local network address and time. 2018-10-25 03:57:09 -07:00
Robert Escriva 268093a96d Adjust all includes to be relative to the root.
Remove the use of relative paths.  A header at foo/bar.h could be included by
files under foo/ with "bar.h", but would be included everywhere else as
"foo/bar.h".  Adjust so that every include references such a header with the
latter form.

Signed-off-by: Robert Escriva <rescriva@dropbox.com>
2018-10-19 17:35:33 +00:00
Evan Tschannen 8dd900a337 fixed the windows build 2018-10-18 20:26:45 -07:00
Stephen Atherton d7d2b58fef Increased several testing parameters which exposed new bugs. Bug fix, PrefixTree's current format does not support trees larger than 64k. Cleaned up some debug output. 2018-09-24 02:42:23 -07:00
Stephen Atherton 4df093f1ea Implemented large key support by adding a superpage concept which is (currently) a BTree-level construct that treats multiple pages from the pager as a single contiguous page, splitting it up on write and reconstituting it on read. Refactored how pages are written along the way. The superpage construct will later be replaced by variable sized page support in IPager. 2018-09-19 00:32:39 -07:00
Stephen Atherton ee17854713 Bug fixes in internal page boundaries and prefix tree overhead calculations. Improved performance test output and increased amount of work it can do. Removed temporary restrictions on correctness test parameter ranges. 2018-06-14 17:52:25 -07:00
Stephen Atherton 248dab79b6 Created “redwood” storage engine option and many changes to support that including IKeyValueStore::init() and custom DiskQueue file extensions. 2017-09-21 23:51:55 -07:00
Stephen Atherton d880569d52 Checkpointing progress on KeyValueStoreMVBTree. All methods are implemented to a usable point, and everything compiles, but Worker does not yet try to use it. 2017-09-21 04:43:49 -07:00
Stephen Atherton 15622f026e Forward range reads are done. 2017-09-15 17:27:13 -07:00
Stephen Atherton 125d8168b4 Checkpointing progress on range reads (ordered iteration of user visible kv pairs via cursor). Added InternalCursor class which is used for all seeks and reads and sees the multi version, fragmented kv pairs and clears. Fixed a bug in commit which was discovered by the range read test where kv pairs (full or partial) could be missing from the tree but only for versions where they did not change. The write verification test did not find this because it only verifies exactly the changed versions of each key. The range test is not finished yet. 2017-09-15 05:19:39 -07:00
Stephen Atherton fe2d104000 Debug macro needs to be 1 instead of just being defined when it is in use. 2017-09-01 21:24:26 -07:00
Stephen Atherton d61f74e52b Debug output changes. 2017-07-14 13:39:58 -07:00
Stephen Atherton fc0557252b Bug fixes. Btree now uses page 0 as root and will write initial page only if necessary. Added debug printf macro. 2017-07-14 11:36:49 -07:00
Stephen Atherton b65ad3563c Merge branch 'master' into feature-redwood
# Conflicts:
#	fdbserver/fdbserver.vcxproj
#	fdbserver/fdbserver.vcxproj.filters
2017-06-09 14:56:41 -07:00