Commit Graph

9 Commits (09ff73b9a728580290b782419771e747c275c8e4)

Author SHA1 Message Date
Thomas Jungblut 3ce0fd0ad5 add freelist interface unit tests
adding more unit tests for better coverage of the interface.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2024-08-20 10:44:26 +02:00
Benjamin Wang 257eadc054 rollback alloc map: remove all page ids which are allocated by the txid
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-08-12 16:05:21 +01:00
Thomas Jungblut 33b71a50af Dedupe Reload/NoSyncReload, prefer empty instead of nil init
Reload and NoSyncReload have duplicated code, this unifies both
for later refactoring.

This PR is split from #786, where the tests found differences on reloading
and nil/empty initializations. Added some more clarifications in godocs
for certain panic behavior and expected returns on the interface.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2024-08-06 11:20:34 +02:00
Benjamin Wang da1c83cbeb panicking when a write txn tries to free a page which was allocated by itself
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-07-30 08:41:22 +01:00
Benjamin Wang 49c7697344
Merge pull request #794 from tjungblu/791_inconsistency
ensure hashmap init clears maps
2024-07-30 08:37:25 +01:00
Thomas Jungblut f4de460a1b add testcases for hashmap init
This also rectifies a bunch of nil/empty differences between the
implementation that show up during init and page releases.

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2024-07-22 16:52:06 +02:00
Thomas Jungblut ce50f55c6e ensure hashmap init clears maps
This reorders some statements in the hashmap initialization to ensure we
always start fresh, even when no pageids were passed to it.

fixes #791

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2024-07-22 16:20:01 +02:00
Benjamin Wang d1cd0deee6 No need to handle freelist as a specical case when freeing a page
Signed-off-by: Benjamin Wang <benjamin.ahrtr@gmail.com>
2024-07-17 13:25:50 +01:00
Thomas Jungblut 62e81c036f introduce a freelist interface
This introduces an interface for the freelist, splits it into two concrete
implementations.

fixes etcd-io#773

Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
2024-07-09 10:41:35 +02:00