@@ -545,8 +545,9 @@ struct __pmem_page_log_hashed_line {
545545 uint64_t recv_lsn ; //min lsn of block's beginLSN in this line
546546 /*end test */
547547
548- uint64_t n_blocks ; //the total log block in bucket
549548 TOID_ARRAY (TOID (PMEM_PAGE_LOG_BLOCK )) arr ;
549+ uint64_t n_blocks ; //the current non-free blocks
550+ uint64_t max_blocks ; //the total log block in bucket
550551
551552 //Alternative to recv_sys_t in InnoDB, allocate in DRAM when recovery
552553 PMEM_RECV_LINE * recv_line ;
@@ -598,7 +599,7 @@ struct __pmem_page_log_buf {
598599struct __pmem_page_log_block {
599600 PMEMrwlock lock ;
600601 bool is_free ; //flag
601- uint32_t bid ; //block id
602+ uint64_t bid ; //block id
602603 uint64_t key ; //fold id
603604
604605 //uint64_t cur_size; //the current offset (0 - log block size)
@@ -688,7 +689,8 @@ pm_log_redoer_close(PMEM_LOG_REDOER* redoer);
688689// Dirty Page Entry Ref in the log block
689690struct __pmem_page_ref {
690691 uint64_t key ; //fold of page_id_t.fold() in InnoDB
691- int64_t idx ; // index of the entry in DPT
692+ //int64_t idx; // index of the entry in DPT
693+ uint64_t idx ; // index of the entry in DPT
692694 uint64_t pageLSN ; //latest LSN on this page caused by the host transction, this value used in reclaiming logs
693695};
694696
@@ -708,8 +710,10 @@ struct __pmem_tt_hashed_line {
708710 PMEMrwlock lock ;
709711
710712 uint64_t hashed_id ;
711- uint64_t n_entries ; //the total log block in bucket
713+
712714 TOID_ARRAY (TOID (PMEM_TT_ENTRY )) arr ;
715+ uint64_t n_entries ; //current number of entries
716+ uint64_t max_entries ; //capacity (extendable)
713717
714718};
715719
@@ -956,9 +960,20 @@ void __init_tt_entry(
956960 uint64_t k ,
957961 uint64_t pages_per_tx );
958962
963+ uint64_t
964+ pm_ppl_create_entry_id (
965+ uint16_t type ,
966+ uint32_t row ,
967+ uint32_t col );
968+ void
969+ pm_ppl_parse_entry_id (
970+ uint64_t val ,
971+ uint16_t * type ,
972+ uint32_t * row ,
973+ uint32_t * col );
959974
960975/*Called when a mini-transaction write log record to log buffer in the traditional InnoDB*/
961- int64_t
976+ uint64_t
962977pm_ppl_write (
963978 PMEMobjpool * pop ,
964979 PMEM_PAGE_PART_LOG * ppl ,
@@ -968,10 +983,9 @@ pm_ppl_write(
968983 uint64_t n_recs ,
969984 uint64_t * key_arr ,
970985 uint64_t * size_arr ,
971- //uint64_t* LSN_arr,
972986 uint64_t * ret_start_lsn ,
973987 uint64_t * ret_end_lsn ,
974- int64_t block_id );
988+ uint64_t block_id );
975989
976990void __handle_pm_ppl_write_by_entry (
977991 PMEMobjpool * pop ,
@@ -988,7 +1002,7 @@ void __handle_pm_ppl_write_by_entry(
9881002 PMEM_TT_ENTRY * pe ,
9891003 bool is_new );
9901004
991- int64_t
1005+ uint64_t
9921006__update_page_log_block_on_write (
9931007 PMEMobjpool * pop ,
9941008 PMEM_PAGE_PART_LOG * ppl ,
@@ -998,7 +1012,7 @@ __update_page_log_block_on_write(
9981012 uint64_t key ,
9991013 uint64_t * LSN ,
10001014 int64_t eid ,
1001- int64_t bid );
1015+ uint64_t bid );
10021016
10031017PMEM_PAGE_LOG_BLOCK *
10041018__get_log_block_by_id (
@@ -1094,7 +1108,7 @@ pm_ppl_commit(
10941108 PMEMobjpool * pop ,
10951109 PMEM_PAGE_PART_LOG * ppl ,
10961110 uint64_t tid ,
1097- int64_t eid );
1111+ uint64_t eid );
10981112void
10991113pm_ppl_flush_page (
11001114 PMEMobjpool * pop ,
@@ -1293,12 +1307,24 @@ __update_page_log_block_on_commit(
12931307 PMEMobjpool * pop ,
12941308 PMEM_PAGE_PART_LOG * ppl ,
12951309 PMEM_PAGE_REF * pref ,
1296- int64_t eid );
1310+ uint64_t eid );
12971311void
12981312__reset_TT_entry (
12991313 PMEMobjpool * pop ,
13001314 PMEM_PAGE_PART_LOG * ppl ,
13011315 PMEM_TT_ENTRY * pe );
1316+
1317+ void __realloc_page_log_block_line (
1318+ PMEMobjpool * pop ,
1319+ PMEM_PAGE_PART_LOG * ppl ,
1320+ PMEM_PAGE_LOG_HASHED_LINE * pline ,
1321+ uint64_t new_size );
1322+
1323+ void __realloc_TT_line (
1324+ PMEMobjpool * pop ,
1325+ PMEM_PAGE_PART_LOG * ppl ,
1326+ PMEM_TT_HASHED_LINE * pline ,
1327+ uint64_t new_size );
13021328void
13031329__realloc_TT_entry (
13041330 PMEMobjpool * pop ,
0 commit comments