diff options
| author | Douglas Rumbaugh <dbr4@psu.edu> | 2024-02-09 12:42:55 -0500 |
|---|---|---|
| committer | Douglas Rumbaugh <dbr4@psu.edu> | 2024-02-09 12:42:55 -0500 |
| commit | aa1b40e9249afc03bf1a2f35de4cbf67c7f9b47e (patch) | |
| tree | 5c9b6124b8c3f9f0ae2b9537890a5b4f3dd9f72e /include/framework | |
| parent | 402fc269c0aaa671d84a6d15918735ad4b90e6b2 (diff) | |
| download | dynamic-extension-aa1b40e9249afc03bf1a2f35de4cbf67c7f9b47e.tar.gz | |
Framework: Fixed a bug where tagged deletes didn't release the epoch
Diffstat (limited to 'include/framework')
| -rw-r--r-- | include/framework/DynamicExtension.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/include/framework/DynamicExtension.h b/include/framework/DynamicExtension.h index 473592d..238fc7f 100644 --- a/include/framework/DynamicExtension.h +++ b/include/framework/DynamicExtension.h @@ -124,12 +124,18 @@ public: * not *strictly* necessary. */ if constexpr (D == DeletePolicy::TAGGING) { - auto view = m_buffer->get_buffer_view(); static_assert(std::same_as<SCHED, SerialScheduler>, "Tagging is only supported in single-threaded operation"); - if (get_active_epoch()->get_structure()->tagged_delete(rec)) { + + auto view = m_buffer->get_buffer_view(); + + auto epoch = get_active_epoch(); + if (epoch->get_structure()->tagged_delete(rec)) { + end_job(epoch); return 1; } + end_job(epoch); + /* * the buffer will take the longest amount of time, and * probably has the lowest probability of having the record, @@ -470,6 +476,15 @@ private: do { old = m_previous_epoch.load(); + /* + * If running in single threaded mode, the failure to retire + * an Epoch will result in the thread of execution blocking + * indefinitely. + */ + if constexpr (std::same_as<SCHED, SerialScheduler>) { + if (old.epoch == epoch) assert(old.refcnt == 0); + } + if (old.epoch == epoch && old.refcnt == 0 && m_previous_epoch.compare_exchange_strong(old, new_ptr)) { break; |