fixed begin lsn smaller then end lsn when there is no log on disk
This commit is contained in:
		| @ -135,6 +135,7 @@ int LogEngine::init(const int64_t palf_id, | ||||
|     alloc_mgr_ = alloc_mgr; | ||||
|     log_io_worker_ = log_io_worker; | ||||
|     palf_epoch_ = palf_epoch; | ||||
|     base_lsn_for_block_gc_ = log_meta.get_log_snapshot_meta().base_lsn_; | ||||
|     is_inited_ = true; | ||||
|     PALF_LOG(INFO, "LogEngine init success", K(ret), K(palf_id), K(base_dir), K(palf_epoch)); | ||||
|   } | ||||
|  | ||||
| @ -431,11 +431,14 @@ const LSN LogStorage::get_begin_lsn() const | ||||
| { | ||||
|   int ret = OB_SUCCESS; | ||||
|   LSN lsn; | ||||
|   lsn.val_ = 0; | ||||
|   block_id_t min_block_id = LOG_INVALID_BLOCK_ID; | ||||
|   block_id_t max_block_id = LOG_INVALID_BLOCK_ID; | ||||
|   if (OB_FAIL(get_block_id_range(min_block_id, max_block_id))) { | ||||
|     if (OB_ENTRY_NOT_EXIST == ret) { | ||||
|       lsn = log_tail_; | ||||
|     } else { | ||||
|       PALF_LOG(WARN, "get_block_id_range failed", K(ret), KPC(this)); | ||||
|     } | ||||
|   } else { | ||||
|     lsn.val_ = logical_block_size_ * min_block_id; | ||||
|   } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 HaHaJeff
					HaHaJeff