Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
209 commits
Select commit Hold shift + click to select a range
806e6ab
making it official
rtjohnso Jul 27, 2023
0c9ea58
minor tweaks
rtjohnso Jul 27, 2023
ec42d2d
Merge remote-tracking branch 'origin/main' into robj/trunk-rewrite
rtjohnso Jul 28, 2023
fa01100
more work
rtjohnso Jul 31, 2023
d4e1d6c
more work
rtjohnso Jul 31, 2023
28a42f7
saving old vector code before deleting it
rtjohnso Aug 6, 2023
8324911
stuff
rtjohnso Aug 7, 2023
a4a73aa
Merge remote-tracking branch 'origin/main' into robj/trunk-rewrite
rtjohnso Aug 7, 2023
3eb8c0e
done w/ leaf splits
rtjohnso Aug 7, 2023
ba9841a
about to try vectorizing everything
rtjohnso Aug 7, 2023
987b4cf
figuring out vector api
rtjohnso Aug 12, 2023
38a22b3
more work on node splitting
rtjohnso Aug 14, 2023
fccd941
finished index splitting
rtjohnso Aug 14, 2023
a29de7c
finished index splitting
rtjohnso Aug 14, 2023
125aae0
start on flushing
rtjohnso Aug 15, 2023
006eb88
almost done with incorporate
rtjohnso Aug 18, 2023
7359f6e
incorporate written
rtjohnso Aug 20, 2023
d51ad72
more
rtjohnso Aug 20, 2023
104ed7e
some work on bundle compactions
rtjohnso Aug 21, 2023
53b45a8
some work on bundle compactions
rtjohnso Aug 21, 2023
442176f
acounting bugfixes, start of maplet compaction
rtjohnso Aug 26, 2023
30cd266
more work on maplet compaction
rtjohnso Aug 27, 2023
2869b00
more work on maplet compaction
rtjohnso Aug 27, 2023
aa9d74c
beginning to fix up leaf splits
rtjohnso Aug 28, 2023
bf9221b
mark everything static
rtjohnso Aug 28, 2023
2c6d3aa
about to start new approach to compaction tracking
rtjohnso Sep 9, 2023
fdde0fe
new new approach w only routed bundles
rtjohnso Sep 11, 2023
08c87a8
working
rtjohnso Sep 12, 2023
6ee7522
compiles
rtjohnso Sep 13, 2023
aa65d8f
working out some locking
rtjohnso Sep 13, 2023
64c732e
clean up some names
rtjohnso Sep 23, 2023
85a0afa
more serialization code
rtjohnso Sep 24, 2023
26e1e3f
finished deserialization
rtjohnso Sep 25, 2023
b13d164
minor tweaks
rtjohnso Sep 26, 2023
c62a1a4
point queries
rtjohnso Sep 26, 2023
c02f84d
range-query support
rtjohnso Sep 26, 2023
24d72e3
start on stats
rtjohnso Sep 27, 2023
61540e1
prep header
rtjohnso Sep 27, 2023
a6e4b61
fix stupid bug
rtjohnso Sep 29, 2023
aee2764
appears able to do an incorporation
rtjohnso Sep 30, 2023
47f5fba
deserliazation bugfix
rtjohnso Oct 1, 2023
48212be
still fixing bugs
rtjohnso Oct 1, 2023
ebbb85c
fix inter-thread iterator bug in trunk_node compaction
rtjohnso Oct 3, 2023
2debd62
fix serialization accounting bug
rtjohnso Oct 3, 2023
9ec5f13
fixed receive_bundles accounting bug
rtjohnso Oct 3, 2023
fbb3aa8
more work
rtjohnso Oct 7, 2023
203c858
fix some splitting bugs
rtjohnso Oct 7, 2023
11e62d3
fix index_split bug
rtjohnso Oct 8, 2023
d694dda
don't enqueue empty compactions
rtjohnso Oct 8, 2023
e68163f
further debugging
rtjohnso Oct 9, 2023
ace4bb5
formatting
rtjohnso Oct 9, 2023
734d1c1
compaction bug
rtjohnso Oct 9, 2023
3618829
compaction filter refcounting bug
rtjohnso Oct 9, 2023
810e9ae
add matching pivot_bundles when we add new children
rtjohnso Oct 9, 2023
1f59773
switch to larger refcounting integers
rtjohnso Oct 10, 2023
0f7c2a1
typedef the refcount int type, log more errors in trunknode
rtjohnso Nov 7, 2023
ae1bf0c
typos
rtjohnso Nov 7, 2023
b8f72b8
debugging
rtjohnso Jan 29, 2024
46a2750
updated to current main
rtjohnso Jan 29, 2024
12799f7
several minor bugs
rtjohnso Aug 9, 2024
104d86a
handle empty branches from compactions
rtjohnso Aug 10, 2024
9cb2610
fix mount/unmount typos
rtjohnso Aug 10, 2024
75e1c8d
allow mounting NULL trunks
rtjohnso Aug 10, 2024
d292a9d
fix up trunk_collect_branches to better match needs of trunk iterator…
rtjohnso Aug 10, 2024
fb1f04e
implement range queries, compiles but fails tests
rtjohnso Aug 11, 2024
a0b892a
fix couple of silly bugs
rtjohnso Aug 11, 2024
d6e3215
fix several bugs in iteration code
rtjohnso Aug 13, 2024
2e08609
fix btree iterator signed comparison bug
rtjohnso Aug 13, 2024
e486a81
Merge branch 'main' into robj/iterator-signed-comparison-bug
rtjohnso Aug 13, 2024
89ccb11
fix btree iterator signed comparison bug
rtjohnso Aug 13, 2024
76430b7
Merge branch 'robj/iterator-signed-comparison-bug' of github.com:vmwa…
rtjohnso Aug 13, 2024
602d9df
merge with recent main changes
rtjohnso Aug 13, 2024
246d1ec
fix collect branches bug, merge iterator bug, trunk_node merge lookup…
rtjohnso Aug 16, 2024
0d223c0
implement trunk_node_destroy, fix some filter refcounting bugs
rtjohnso Aug 16, 2024
2a9e00d
new refcounting approach compiles
rtjohnso Aug 19, 2024
931c18c
rename rc_pivot to ondisk_node_ref
rtjohnso Aug 19, 2024
0c029c6
fix a couple of old names based on rc_pivot
rtjohnso Aug 19, 2024
2161a15
fix filter refcounting bug
rtjohnso Aug 22, 2024
b4c3ebf
Fix use-after-realloc bugs, deserialization bug
rtjohnso Aug 23, 2024
7464f3d
make pivot_stats signed, fix maplet_compaction application, improve d…
rtjohnso Aug 24, 2024
f3fabfc
simplify management of pivot compaction states
rtjohnso Aug 24, 2024
9f6010c
fix silly branch ordering bugs in compaction/iteration
rtjohnso Aug 25, 2024
dde8054
lots of diagnostics
rtjohnso Aug 25, 2024
6f5d31d
fix bug on collect_branches failure path
rtjohnso Aug 25, 2024
3d65585
fixed compaction bugs based on bundle/branch ordering
rtjohnso Aug 26, 2024
8ece7e7
Merge remote-tracking branch 'origin/main' into robj/trunk-rewrite
rtjohnso Aug 28, 2024
ad008bd
build new bundle compactions based on existing pivot state rather tha…
rtjohnso Aug 28, 2024
ec9585e
fix compaction bug. again.
rtjohnso Aug 29, 2024
9aaa18c
start fixing bundle compaction enqueuing race with root update, minor…
rtjohnso Sep 2, 2024
187c112
fix bundle_compaction_enqueue/root-update race
rtjohnso Sep 12, 2024
5c57ee6
switch to a policy more like flush-to-fullest
rtjohnso Sep 12, 2024
a4198ea
call cache_discard_extent when deallocing trunk nodes
rtjohnso Sep 12, 2024
c402b39
remove keyed mini_allocator
rtjohnso Sep 14, 2024
6a1c4c2
leave mini_allocator contents in place after release
rtjohnso Sep 14, 2024
13b0cd8
remove _range versions of btree refcounting functions
rtjohnso Sep 14, 2024
7e3b6c5
add some statistics and early bailout on abandoned compactions
rtjohnso Sep 16, 2024
c69678e
add stats collection hooks
rtjohnso Sep 16, 2024
ed50fa0
add stats collection and printing to new trunk impl, cut out much now…
rtjohnso Sep 20, 2024
c41f202
edit website to remove tealium and switch to gtm
rtjohnso Sep 20, 2024
03fa561
merge main
rtjohnso Sep 20, 2024
9492fee
merge main
rtjohnso Sep 20, 2024
e9ad06b
remove unused trunk.c functions
rtjohnso Sep 20, 2024
e277865
fix space leakage bug
rtjohnso Sep 22, 2024
d40df2c
implement lookup printing
rtjohnso Sep 22, 2024
310872b
fix some uninitialized data reads
rtjohnso Sep 24, 2024
7584375
Fix some gcc errors
rtjohnso Sep 24, 2024
afc2c7a
Merge branch 'main' into robj/trunk-rewrite
rtjohnso Sep 24, 2024
208ccd5
Merge remote-tracking branch 'origin/main' into robj/trunk-rewrite
rtjohnso Sep 24, 2024
8ba71f0
fix memory leaks and cleanup trunk/trunk_node interaction some
rtjohnso Oct 9, 2024
5434cad
initial version of async.h
rtjohnso Oct 9, 2024
d692400
btree new async in progress
rtjohnso Nov 14, 2024
8611ea6
new async io infrastructure and start to refactor clockcache_get
rtjohnso Nov 27, 2024
2f697f3
new async io infrastructure and start to refactor clockcache_get
rtjohnso Nov 27, 2024
9d04f92
new async io infrastructure and start to refactor clockcache_get
rtjohnso Nov 27, 2024
505d536
more work on async
rtjohnso Nov 27, 2024
99235a9
more work
rtjohnso Nov 27, 2024
e90719f
convert io async to inline buffer
rtjohnso Nov 28, 2024
e72c08d
more async clockcache
rtjohnso Dec 3, 2024
78d9d5e
implement clockcache_get using async version
rtjohnso Dec 3, 2024
d5a0629
bugfixes
rtjohnso Dec 4, 2024
28ec83f
add async.c
rtjohnso Dec 4, 2024
14a4be9
more bugfixes and cleanups
rtjohnso Dec 5, 2024
c85aa86
encapsulate algorithm for safely waiting on a queue
rtjohnso Dec 5, 2024
f4386d6
expose new cache_get_async2 api via cache.h
rtjohnso Dec 5, 2024
82053e6
cleanups
rtjohnso Dec 6, 2024
cb3d984
working on async subroutine support
rtjohnso Dec 7, 2024
f9ac5e3
more work on async subroutines
rtjohnso Dec 7, 2024
6e65e60
btree async lookup
rtjohnso Dec 7, 2024
8b815a1
btree_test uses new async impl
rtjohnso Dec 8, 2024
7b8bf00
add async_status type
rtjohnso Dec 8, 2024
1cbc71a
document async.h
rtjohnso Dec 8, 2024
b296d09
async2 impl for routing_filter
rtjohnso Dec 15, 2024
4b1c676
working to cleanup trunk query path
rtjohnso Dec 19, 2024
0b47eb5
fix dumb inflight_bundles_offset bug
rtjohnso Dec 19, 2024
aee123d
typed in trunk_node async lookup code
rtjohnso Dec 23, 2024
bc02d05
fix first_inflight_bundle caller bug
rtjohnso Dec 23, 2024
01dfda0
fix find_pivot_async comparions bug
rtjohnso Dec 24, 2024
9a266fd
restore synchronous trunk_node query impl
rtjohnso Dec 24, 2024
a5e3a32
merge recent changes to main
rtjohnso Dec 25, 2024
9a2c2fc
wire up new async code to tests
rtjohnso Dec 25, 2024
ae6450b
removing old async code
rtjohnso Dec 25, 2024
c885ed3
update cache_test, make cache async gets resilient to abandonment
rtjohnso Dec 26, 2024
ab556de
working to convert cache_prefetch to new async system
rtjohnso Dec 27, 2024
693b890
merge in memory-leak fixes and fix race in async.h
rtjohnso Dec 28, 2024
aadee6f
finally got it to work
rtjohnso Dec 28, 2024
d1a2f92
finally got prefetching to work
rtjohnso Dec 28, 2024
55a7715
generalize async reads to reads and writes
rtjohnso Dec 29, 2024
e9c492e
minor tweak
rtjohnso Dec 29, 2024
2f7a989
minor tweak
rtjohnso Dec 29, 2024
5e695bc
get new async prefetch impl working w/ multiple processes
rtjohnso Jan 10, 2025
2d7a98b
reduce cpu usage of laio_cleaner threads
rtjohnso Jan 11, 2025
45b05c0
convert writeback to new async system
rtjohnso Jan 11, 2025
7c342e5
convert writeback to new async system
rtjohnso Jan 11, 2025
478f050
convert writeback to new async system
rtjohnso Jan 11, 2025
7d2810f
convert io_apis_test to new api
rtjohnso Jan 12, 2025
88f3848
cleanup io.h and laio.[hc]
rtjohnso Jan 12, 2025
708b57a
cleanup async names
rtjohnso Jan 12, 2025
29459e2
turn async back on in tests
rtjohnso Jan 13, 2025
f7d3ee1
delete dead trunk config stuff
rtjohnso Jan 13, 2025
5fcefd7
fix minor test bug related to 0 scratch sizes
rtjohnso Jan 14, 2025
e1dbcca
lock async state structs upon entry to async function
rtjohnso Jan 18, 2025
5427565
lock async states
rtjohnso Jan 19, 2025
1faf069
eliminate async locking by improving control flow is laio_async_run
rtjohnso Jan 24, 2025
48da0ff
make async io always return RUNNING on first call, fix clockcache ref…
rtjohnso Jan 22, 2025
30ada52
remove outdated limitations test
rtjohnso Jan 17, 2025
d1bb3a0
turn off short read message
rtjohnso Jan 21, 2025
f943c9f
add static assert for clockcache refcount size
rtjohnso Jan 22, 2025
4cc721f
check for success on thread registration
rtjohnso Jan 24, 2025
c354dd1
Merge branch 'main' into robj/trunk-rewrite
rtjohnso Jan 24, 2025
8e642d9
get trunk_node.c ready to receive memtables
rtjohnso Jan 14, 2025
6fc7a04
getting trunk_node.c ready to receive memtables
rtjohnso Jan 15, 2025
e4bab04
make trunk_node respect routing filter limits in leaves
rtjohnso Jan 28, 2025
52b02fd
working to rationalize compaction policies
rtjohnso Jan 28, 2025
7e369fd
abandon compactions on rebundle of a leaf
rtjohnso Jan 28, 2025
06d58f4
working to rationalize compaction policies
rtjohnso Jan 28, 2025
bc50e83
fix silly bugs in handling bundles with null filters
rtjohnso Jan 28, 2025
60211b7
cleanups
rtjohnso Jan 29, 2025
7df4181
reorged filter config
rtjohnso Jan 31, 2025
f533922
track down some bugs w/ filter index size config
rtjohnso Jan 31, 2025
04f60ec
maybe fixed bug in RadixSort
rtjohnso Jan 31, 2025
7690f61
minor cleanups
rtjohnso Jan 31, 2025
96264e1
rewrote laio_async_run to avoid label inside of statement expression
rtjohnso Feb 7, 2025
d62278b
fix EAGAIN sign bug
rtjohnso Feb 7, 2025
55081ad
cleanup some headers
rtjohnso Feb 22, 2025
834577c
rename trunk[hc] to core.[hc]
rtjohnso Feb 22, 2025
6379839
cleanup some old stats code
rtjohnso Feb 22, 2025
526403f
rename trunk.[hc] to core.[hc]
rtjohnso Feb 28, 2025
c510e94
more naming cleanups
rtjohnso Mar 1, 2025
4cacf59
finish cleanup/renames in trunk.c
rtjohnso Mar 2, 2025
efe6442
finish cleanup/renames in trunk.c
rtjohnso Mar 2, 2025
ade19b9
merge
rtjohnso Mar 4, 2025
9d32b5d
fix incorporation/lookup race
rtjohnso Mar 6, 2025
acf129f
formatting
rtjohnso Mar 7, 2025
2864bef
fix gcc warning
rtjohnso Mar 7, 2025
3cab928
fix duplicate maplet_task enqueuing, manifested as RadixSort crash
rtjohnso Mar 7, 2025
9559e1a
stop using poorly defined task_wait_for_completion
rtjohnso Mar 8, 2025
b257167
fast path async_wait_queue_release_{one,all}
rtjohnso Mar 13, 2025
a5814c2
fast path async_wait_queue_release_{one,all}
rtjohnso Mar 13, 2025
a11ed0d
Merge remote-tracking branch 'refs/remotes/origin/robj/trunk-rewrite'…
rtjohnso Apr 19, 2025
48bc52b
working on async slowest and lost cache load completions
rtjohnso May 6, 2025
1c90181
fix async_wait_queue bug; tighten cache page_type tracking
rtjohnso May 28, 2025
b453be9
fix several page_type bugs
rtjohnso May 28, 2025
e357fce
cleaning up for merge
rtjohnso May 30, 2025
8be583c
more cleanup
rtjohnso May 31, 2025
2d890c0
turn off forked child tests since they fail mysteriously on CI
rtjohnso May 31, 2025
1c575ac
disable some more shared memory tests since it is unstable
rtjohnso Jun 2, 2025
b3e796d
drafted space usage reporting
rtjohnso Jun 13, 2025
bcab2f8
debugging space printing code
rtjohnso Jun 13, 2025
c0b3332
finished space reporting
rtjohnso Jun 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ BUILD_DIR := $(BUILD_MODE)
ifeq "$(BUILD_MODE)" "debug"
CFLAGS += -DSPLINTER_DEBUG
else ifeq "$(BUILD_MODE)" "release"
CFLAGS += -Ofast -flto
LDFLAGS += -Ofast -flto
CFLAGS += -O3 -ffast-math -flto
LDFLAGS += -O3 -ffast-math -flto
else ifeq "$(BUILD_MODE)" "optimized-debug"
CFLAGS += -DSPLINTER_DEBUG
CFLAGS += -Ofast -flto
LDFLAGS += -Ofast -flto
CFLAGS += -O3 -ffast-math -flto
LDFLAGS += -O3 -ffast-math -flto
else
$(error Unknown BUILD_MODE "$(BUILD_MODE)". Valid options are "debug", "optimized-debug", and "release". Default is "release")
endif
Expand Down Expand Up @@ -161,8 +161,8 @@ ifndef BUILD_MSAN
endif

ifeq "$(BUILD_MSAN)" "1"
CFLAGS += -fsanitize=memory
LDFLAGS += -fsanitize=memory
CFLAGS += -fsanitize=memory -fsanitize-memory-track-origins
LDFLAGS += -fsanitize=memory -fsanitize-memory-track-origins
BUILD_DIR:=$(BUILD_DIR)-msan
else ifneq "$(BUILD_MSAN)" "0"
$(error Unknown BUILD_MSAN mode "$(BUILD_MSAN)". Valid values are "0" or "1". Default is "0")
Expand Down Expand Up @@ -413,6 +413,7 @@ BTREE_SYS = $(OBJDIR)/$(SRCDIR)/btree.o \
# defined above using unit_test_self_dependency.
#
$(BINDIR)/$(UNITDIR)/misc_test: $(UTIL_SYS) $(COMMON_UNIT_TESTOBJ)
$(BINDIR)/$(UNITDIR)/vector_test: $(UTIL_SYS) $(COMMON_UNIT_TESTOBJ)

$(BINDIR)/$(UNITDIR)/util_test: $(UTIL_SYS) \
$(COMMON_UNIT_TESTOBJ)
Expand Down
5 changes: 2 additions & 3 deletions include/splinterdb/splinterdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,15 @@ typedef struct splinterdb_config {
uint64 btree_rough_count_height;

// filter
uint64 filter_remainder_size;
uint64 filter_index_size;
uint64 filter_hash_size;
uint64 filter_log_index_size;

// log
_Bool use_log;

// splinter
uint64 memtable_capacity;
uint64 fanout;
uint64 max_branches_per_node;
uint64 use_stats;
uint64 reclaim_threshold;

Expand Down
20 changes: 11 additions & 9 deletions src/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@ allocator_config_pages_share_extent(allocator_config *allocator_cfg,
// ----------------------------------------------------------------------
// Type declarations for allocator ops

typedef uint32 refcount;

typedef struct allocator allocator;

typedef allocator_config *(*allocator_get_config_fn)(allocator *al);
Expand All @@ -122,8 +124,8 @@ typedef platform_status (*alloc_fn)(allocator *al,
uint64 *addr,
page_type type);

typedef uint8 (*dec_ref_fn)(allocator *al, uint64 addr, page_type type);
typedef uint8 (*generic_ref_fn)(allocator *al, uint64 addr);
typedef refcount (*dec_ref_fn)(allocator *al, uint64 addr, page_type type);
typedef refcount (*generic_ref_fn)(allocator *al, uint64 addr);

typedef platform_status (*get_super_addr_fn)(allocator *al,
allocator_root_id spl_id,
Expand Down Expand Up @@ -182,19 +184,19 @@ allocator_alloc(allocator *al, uint64 *addr, page_type type)
return al->ops->alloc(al, addr, type);
}

static inline uint8
static inline refcount
allocator_inc_ref(allocator *al, uint64 addr)
{
return al->ops->inc_ref(al, addr);
}

static inline uint8
static inline refcount
allocator_dec_ref(allocator *al, uint64 addr, page_type type)
{
return al->ops->dec_ref(al, addr, type);
}

static inline uint8
static inline refcount
allocator_get_refcount(allocator *al, uint64 addr)
{
return al->ops->get_ref(al, addr);
Expand Down Expand Up @@ -268,18 +270,18 @@ allocator_page_valid(allocator *al, uint64 addr)

uint64 base_addr = allocator_config_extent_base_addr(allocator_cfg, addr);
if ((base_addr != 0) && (addr < allocator_cfg->capacity)) {
uint8 refcount = allocator_get_refcount(al, base_addr);
if (refcount == 0) {
refcount rfc = allocator_get_refcount(al, base_addr);
if (rfc == 0) {
platform_error_log(
"%s():%d: Trying to access an unreferenced extent."
" base_addr=%lu, addr=%lu, allocator_get_refcount()=%d\n",
__func__,
__LINE__,
base_addr,
addr,
refcount);
rfc);
}
return (refcount != 0);
return (rfc != 0);
} else {
platform_error_log("%s():%d: Extent out of allocator capacity range."
" base_addr=%lu, addr=%lu"
Expand Down
Loading
Loading