Skip to content

Commit

Permalink
Support for advancing read transactions while retaining accessors: Sh…
Browse files Browse the repository at this point in the history
…aredGroup::advance_read_transact(TransactLogRegistry&)
  • Loading branch information
kspangsege committed May 19, 2014
1 parent cc6d5d1 commit d099937
Show file tree
Hide file tree
Showing 46 changed files with 5,185 additions and 967 deletions.
1 change: 1 addition & 0 deletions .dir-locals.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
;; Project specific Emacs settings
((nil . ((c-basic-offset . 4)
(indent-tabs-mode . nil)
(fill-column . 80)
(c-file-style . "ellemtel")
(c-file-offsets . ((innamespace . 0)))
(show-trailing-whitespace . t))))
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,14 @@ gcovr: check-cover
gcovr --filter='.*src/tightdb.*' -x >gcovr.xml

# Build and run whatever is in test/experiements/testcase.cpp
.PHONY: check-testcase check-testcase-debug memcheck-testcase memcheck-testcase-debug
.PHONY: check-testcase check-testcase-debug check-testcase-debug-norun
.Phony: memcheck-testcase memcheck-testcase-debug
check-testcase: check-norun/subdir/src
@$(MAKE) -C test check-testcase
check-testcase-debug: check-debug-norun/subdir/src
@$(MAKE) -C test check-testcase-debug
check-testcase-debug-norun: check-debug-norun/subdir/src
@$(MAKE) -C test check-testcase-debug-norun
memcheck-testcase: check-norun/subdir/src
@$(MAKE) -C test memcheck-testcase
memcheck-testcase-debug: check-debug-norun/subdir/src
Expand Down
16 changes: 16 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,22 @@ EOF
exit 0
;;

"gdb")
auto_configure || exit 1
export TIGHTDB_HAVE_CONFIG="1"
$MAKE check-debug-norun || exit 1
(cd "test" && gdb tightdb-tests-dbg)
exit 0
;;

"gdb-testcase")
auto_configure || exit 1
export TIGHTDB_HAVE_CONFIG="1"
$MAKE check-testcase-debug-norun || exit 1
(cd "test/experiments" && gdb testcase-dbg)
exit 0
;;

"show-install")
temp_dir="$(mktemp -d /tmp/tightdb.show-install.XXXX)" || exit 1
mkdir "$temp_dir/fake-root" || exit 1
Expand Down
8 changes: 5 additions & 3 deletions release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,21 @@ x.x.x Release notes (yyyy—MM-dd) <<<------------ PLEASE NOTE, THIS IS THE N

C++ (core)
-----------
Adding Table::get_index_in_parent() and Group::get_table(std::size_t table_ndx). They were needed for implicit transactions.

### Bugfixes:

* Fixed bug in TableView::remove(), causing crash or undefined behaviour.
* Fixed bug in TableView::remove() causing crash or undefined behaviour.
* Fixed bugs in Table::insert_column() and Table::remove_column() causing crash or undefined behaviour.
* Fixed corruption bug when a string enumeration column follows a column with attached search index (index flavor mixup).

### API breaking changes:

* `???`

### Enhancements:

* `???`
* Adding Table::get_index_in_parent() and Group::get_table(std::size_t table_ndx). They were needed for implicit transactions.
* Table::get_parent_table() can now also return the index of the column in the parent.

-----------

Expand Down
2 changes: 1 addition & 1 deletion src/tightdb/alloc_slab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ bool SlabAlloc::remap(size_t file_size)
// free space information below, it would be more efficient to
// start by erasing the free space information, then remap, then
// rebuild the free space information. This way, Group::commit()
// and Group::update_from_shared() no longer have to call
// and Group::init_for_transact() no longer have to call
// SlabAlloc::reset_free_space_tracking().

void* addr =
Expand Down
20 changes: 8 additions & 12 deletions src/tightdb/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,10 @@ void Array::init_from_mem(MemRef mem) TIGHTDB_NOEXCEPT

// Parse header
m_is_inner_bptree_node = get_is_inner_bptree_node_from_header(header);
m_has_refs = get_hasrefs_from_header(header);
m_width = get_width_from_header(header);
m_size = get_size_from_header(header);
m_has_refs = get_hasrefs_from_header(header);
m_context_flag = get_context_flag_from_header(header);
m_width = get_width_from_header(header);
m_size = get_size_from_header(header);

// Capacity is how many items there are room for
bool is_read_only = m_alloc.is_read_only(mem.m_ref);
Expand Down Expand Up @@ -298,8 +299,7 @@ MemRef Array::slice(size_t offset, size_t size, Allocator& target_alloc) const
Array slice(target_alloc);
_impl::DeepArrayDestroyGuard dg(&slice);
Type type = get_type();
bool context_flag = get_context_flag();
slice.create(type, context_flag); // Throws
slice.create(type, m_context_flag); // Throws
size_t begin = offset;
size_t end = offset + size;
for (size_t i = begin; i != end; ++i) {
Expand All @@ -320,8 +320,7 @@ MemRef Array::slice_and_clone_children(size_t offset, size_t size, Allocator& ta
Array slice(target_alloc);
_impl::DeepArrayDestroyGuard dg(&slice);
Type type = get_type();
bool context_flag = get_context_flag();
slice.create(type, context_flag); // Throws
slice.create(type, m_context_flag); // Throws
_impl::DeepArrayRefDestroyGuard dg_2(target_alloc);
size_t begin = offset;
size_t end = offset + size;
Expand Down Expand Up @@ -3666,16 +3665,13 @@ void elim_superfluous_bptree_root(Array* root, MemRef parent_mem,
// This child is an inner node, and is the closest one to
// the root that has more than one child, so make it the
// new root.
if (ArrayParent* parent_of_root = root->get_parent()) {
size_t ndx_in_parent = root->get_ndx_in_parent();
parent_of_root->update_child_ref(ndx_in_parent, child_ref); // Throws
}
root->init_from_ref(child_ref);
root->update_parent(); // Throws
// From this point on, the height reduction operation
// cannot be aborted without leaking memory, so the rest
// of the operation must proceed without throwing. This
// includes retrocursive completion of earlier invocations
// of this function.
root->init_from_ref(child_ref);
}
else {
// This child is an inner node, but has itself just one
Expand Down
Loading

0 comments on commit d099937

Please sign in to comment.