-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
freelist hashmap/array inconsistency on page reload #791
Labels
Comments
Thanks @tjungblu for the finding. Indeed the arrary and hashmap freelist have different behavior on
freelist will panic when it tries to free an already freed page. |
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 9, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 9, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 11, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 22, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 22, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 22, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
tjungblu
added a commit
to tjungblu/bbolt
that referenced
this issue
Jul 22, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com>
samuelbartels20
pushed a commit
to samuelbartels20/bbolt
that referenced
this issue
Nov 10, 2024
This reorders some statements in the hashmap initialization to ensure we always start fresh, even when no pageids were passed to it. fixes etcd-io#791 Signed-off-by: Thomas Jungblut <tjungblu@redhat.com> Signed-off-by: samuelbartels20 <bartelssamuel20@gmail.com>
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
While testing the interface in #786, I've noticed a slight divergence in reload behavior between the array and freelist implementation.
Below testcase showcases the difference very well. TL;DR: we create a freelist with free page ids 5,6,8 and then we create a new one which frees the 5 through 9 in a transaction, marking the whole span as pending.
Now reloading the freelist again from the page that contains 5,6,8 will show different results:
The array freelist will pass and detect the span as pending, the hashmap will have the overlapping pages pending and free.
It stems from the fact that on init, the hashmap will not honor an empty list as an initial state (as in, it will not attempt to initialize anything):
https://github.com/etcd-io/bbolt/blob/main/freelist_hmap.go#L197-L200
Whereas the array will happily take what it's passed and reindex accordingly:
https://github.com/etcd-io/bbolt/blob/main/freelist_array.go#L60-L63
The text was updated successfully, but these errors were encountered: