hawq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From liming01 <...@git.apache.org>
Subject [GitHub] incubator-hawq pull request: HAWQ-255: change CHECKPOINT_START_LOC...
Date Fri, 18 Dec 2015 03:22:07 GMT
Github user liming01 commented on a diff in the pull request:

    https://github.com/apache/incubator-hawq/pull/191#discussion_r47990910
  
    --- Diff: src/backend/access/transam/xact.c ---
    @@ -2317,14 +2317,14 @@ CommitTransaction(void)
     	willHaveObjectsFromSmgr =
     			PersistentEndXactRec_WillHaveObjectsFromSmgr(EndXactRecKind_Commit);
     
    -	if (willHaveObjectsFromSmgr)
    -	{
    -		/*
    -		 * We need to ensure the recording of the [distributed-]commit record and the
    -		 * persistent post-commit work will be done either before or after a checkpoint.
    -		 */
    -		CHECKPOINT_START_LOCK;
    -	}
    +	/* In previous version, we ensured the recording of the [distributed-]commit record
and the
    +	 * persistent post-commit work will be done either before or after a checkpoint.
    +	 *
    +	 * However the persistent table status will be synchronized with AOSeg_XXXX
    +	 * table and hdfs file in PersistentRecovery_Scan() at recovery PASS2.
    +	 * We don't need to worry about inconsistent states between them. So no
    +	 * CHECKPOINT_START_LOCK any more.
    +	 */
    --- End diff --
    
    The status of current transaction will not be truncated at (4), the truncate related code
is:
    CreateCheckPoint() --> CheckPointGuts() --> CheckPointMultiXact() -> TruncateMultiXact()
-> SimpleLruTruncate()
    In this function, cutoffPage is based on the min value of OldestMemberMXactId and OldestVisibleMXactId
for all backends' proc. 
    
    And OldestMemberMXactId and OldestVisibleMXactId for current backend's proc are reset
in
    AtEOXact_MultiXact(). In AbortTransaction() and CommitTransaction(), this function is
called after AtEOXact_smgr(). 
    
    So in recovery process, we can know that the current transaction has already committed,
and all persistent table and hdfs files should be redo. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message