@@ -44,7 +44,7 @@ extern volatile int64 gb_write_log_time;
4444extern volatile int64 gb_n_write_log;
4545#endif
4646
47- #if defined (UNIV_PMEMOBJ_PART_PL) || defined (UNIV_PMEMOBJ_WAL_ELR)
47+ #if defined (UNIV_PMEMOBJ_PART_PL) || defined (UNIV_PMEMOBJ_WAL_ELR) || defined(UNIV_PMEMOBJ_WAL)
4848#include " my_pmemobj.h"
4949extern PMEM_WRAPPER* gb_pmw;
5050#endif /* UNIV_PMEMOBJ_PART_PL */
@@ -1369,7 +1369,7 @@ mtr_t::Command::execute()
13691369#endif
13701370}
13711371
1372- #else // old method
1372+ #else // old method for UNIV_SKIPLOG
13731373
13741374// In PL-NVM, we keep log records in our data structure
13751375// This function just release the resource without writing any logs
@@ -1410,8 +1410,9 @@ mtr_t::Command::execute()
14101410 release_resources ();
14111411}
14121412#endif // UNIV_PMEMOBJ_PART_PL
1413- #elif defined (UNIV_PMEMOBJ_WAL) && defined (UNIV_PMEMOBJ_WAL_ELR)
1414- // Early lock release
1413+ // #elif defined (UNIV_PMEMOBJ_WAL) && defined (UNIV_PMEMOBJ_WAL_ELR)
1414+ #elif defined (UNIV_PMEMOBJ_WAL)
1415+ // Centralized logging methods: regular or Early lock release
14151416void
14161417mtr_t ::Command::execute()
14171418{
@@ -1596,7 +1597,10 @@ mtr_t::Command::execute()
15961597#if defined(UNIV_PMEMOBJ_LOG) || defined(UNIV_PMEMOBJ_WAL)
15971598 // update the lsn and buf_free
15981599 gb_pmw->plogbuf ->lsn = log->lsn ;
1600+ pmemobj_persist (gb_pmw->pop , &gb_pmw->plogbuf ->lsn , sizeof (gb_pmw->plogbuf ->lsn ));
1601+
15991602 gb_pmw->plogbuf ->buf_free = log->buf_free ;
1603+ pmemobj_persist (gb_pmw->pop , &gb_pmw->plogbuf ->buf_free , sizeof (gb_pmw->plogbuf ->buf_free ));
16001604#endif /* UNIV_PMEMOBJ_LOG */
16011605 srv_stats.log_write_requests .inc ();
16021606
@@ -1611,21 +1615,26 @@ mtr_t::Command::execute()
16111615 if (m_impl->m_made_dirty ) {
16121616 log_flush_order_mutex_enter ();
16131617 }
1614-
1618+ # if defined (UNIV_PMEMOBJ_WAL_ELR)
16151619 /* It is now safe to release the log mutex because the
16161620 flush_order mutex will ensure that we are the first one
16171621 to insert into the flush list. */
16181622 log_mutex_exit ();
1623+ #endif // UNIV_PMEMOBJ_WAL_ELR
16191624
16201625 // now we do the memcpy
16211626 TX_BEGIN (gb_pmw->pop ) {
16221627 TX_MEMCPY (start_cpy, start_log_ptr, len_cpy);
16231628 } TX_ONABORT {
16241629 } TX_END
1630+
16251631 gb_pmw->plogbuf ->need_recv = true ;
1632+ pmemobj_persist (gb_pmw->pop , &gb_pmw->plogbuf ->need_recv , sizeof (gb_pmw->plogbuf ->need_recv ));
16261633
16271634 m_impl->m_mtr ->m_commit_lsn = m_end_lsn;
1628-
1635+ #if !defined(UNIV_PMEMOBJ_WAL_ELR)
1636+ log_mutex_exit ();
1637+ #endif
16291638 release_blocks ();
16301639
16311640 if (m_impl->m_made_dirty ) {
0 commit comments