[LETS-458] Fix the hang when starting PTS if ATS is stopped
http://jira.cubrid.org/browse/LETS-458
The cause of the hang: When a page is requested with a target lsa by PTS, the target lsa set to the m_redo_lsa, which is the next one to be applied. PS waits for the replication to go past the target LSA and returns the page. If the last redo record is applied, the target lsa points to after the last log record and the PS can't go past it because no log record is generated without ATS.
The solution: Two solutions are suggested. The one is making PS wait for the target LSA, not past. However, In the case of ATS, the target lsa is the highest evicted LSA and it is expected to be applied. The other one is setting the target lsa by PTS to the last applied LSA, not the one that will be applied. This is picked.
Implementation:
- m_proccesed_lsa : before the m_redo_lsa. This is added on the atomic replicator on PTS, not the replicator on PS.
- a new contr argument, prev_lsa, for atomic_replicator: as a default value for the m_processed_lsa.
- get_highest_processed_lsa(): return m_processed_lsa instead of m_redo_lsa
- get_lowest_unapplied_lsa(): return m_redo_lsa instead of get_highest_processed_lsa() in the replicator. All others using m_redo_lsa but fetching page from PS uses this. Now that get_highest_processed_lsa() doesn't return m_redo_lsa, it should be changed to return m_redo_lsa. The get_lowest_unapplied_lsa() in replicator already returns value considering m_redo_lsa.