- 
                Notifications
    
You must be signed in to change notification settings  - Fork 707
 
ticdc: improve description about ticdc compatibility with lightning & BR #21609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            lidezhu
  wants to merge
  7
  commits into
  master
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
ldz/update-lightning-compatibility
  
      
      
   
  
    
  
  
  
 
  
      
    base: master
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Changes from 3 commits
      Commits
    
    
            Show all changes
          
          
            7 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      0391399
              
                ticdc: improve description about ticdc compatibility with lightning & BR
              
              
                lidezhu 8cabf03
              
                Update ticdc/ticdc-faq.md
              
              
                lidezhu d7c9724
              
                Update ticdc/ticdc-faq.md
              
              
                lidezhu 6cc903b
              
                Update ticdc/ticdc-faq.md
              
              
                lidezhu a1e3eb6
              
                Update ticdc/ticdc-faq.md
              
              
                lidezhu 67937d2
              
                Update ticdc/ticdc-faq.md
              
              
                lidezhu 662d9e1
              
                Apply suggestions from code review
              
              
                hfxsd File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| 
          
            
          
           | 
    @@ -369,22 +369,34 @@ In v6.1.3 and later versions, the default value of `safe-mode` changes to `false | |||||
| 
     | 
||||||
| When upstream write traffic is at peak hours, the downstream may fail to consume all data in a timely manner, resulting in data pile-up. TiCDC uses disks to process the data that is piled up. TiCDC needs to write data to disks during normal operation. However, this is not usually the bottleneck for replication throughput and replication latency, given that writing to disks only results in latency within a hundred milliseconds. TiCDC also uses memory to accelerate reading data from disks to improve replication performance. | ||||||
| 
     | 
||||||
| ## Why does replication using TiCDC stall or even stop after data restore using TiDB Lightning physical import mode and BR from upstream? | ||||||
| ## What are the compatibility limitations between TiDB Lightning Physical Import Mode and TiCDC? | ||||||
| 
     | 
||||||
| Currently, TiCDC is not yet fully compatible with [TiDB Lightning physical import mode](/tidb-lightning/tidb-lightning-physical-import-mode.md) and BR. Therefore, avoid using TiDB Lightning physical import mode and BR on tables that are replicated by TiCDC. Otherwise, unknown errors might occur, such as TiCDC replication getting stuck, a significant spike in replication latency, or data loss. | ||||||
| TiDB Lightning [Physical Import Mode](/tidb-lightning/tidb-lightning-physical-import-mode.md) directly generates SST files and imports them into the TiKV cluster. Since this import method does not involve the regular data writing process, it does not generate change log records. In most cases, a changefeed cannot observe this kind of data change. Only during the initialization phase of the changefeed or when Region changes (such as split/merge/leader transfer) trigger incremental scans might this kind of data change be observed. Therefore, a changefeed cannot fully capture data imported via TiDB Lightning Physical Import Mode. | ||||||
| 
     | 
||||||
| If you need to use TiDB Lightning physical import mode or BR to restore data for some tables replicated by TiCDC, take these steps: | ||||||
| If the tables operated by TiDB Lightning Physical Import Mode overlap with the tables monitored by the changefeed, various unknown errors may occur due to incomplete data capture, such as a changefeed stalling or data inconsistency between upstream and downstream. If you need to use TiDB Lightning Physical Import Mode to import tables replicated by TiCDC, follow these steps: | ||||||
| 
     | 
||||||
| 1. Remove the TiCDC replication task related to these tables. | ||||||
| 
     | 
||||||
| 2. Use TiDB Lightning physical import mode or BR to restore data separately in the upstream and downstream clusters of TiCDC. | ||||||
| 2. Use TiDB Lightning physical import mode to restore data separately in the upstream and downstream clusters of TiCDC. | ||||||
| 
     | 
||||||
| 3. After the restoration is complete and data consistency between the upstream and downstream clusters is verified, create a new TiCDC replication task for incremental replication, with the timestamp (TSO) from the upstream backup as the `start-ts` for the task. For example, assuming the snapshot timestamp of the BR backup in the upstream cluster is `431434047157698561`, you can create a new TiCDC replication task using the following command: | ||||||
| 3. After the restoration is complete and the data consistency of the corresponding tables in the upstream and downstream clusters has been verified, use the timestamp (TSO) after the completion of TiDB Lightning Physical Import Mode as the start-ts of the TiCDC replication task to create a new TiCDC replication task for incremental replication. | ||||||
                
      
                  lidezhu marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
                
      
                  hfxsd marked this conversation as resolved.
               
              
                Outdated
          
            Show resolved
            Hide resolved
         | 
||||||
| 
     | 
||||||
| ```shell | ||||||
| cdc cli changefeed create -c "upstream-to-downstream-some-tables" --start-ts=431434047157698561 --sink-uri="mysql://[email protected]:4000? time-zone=" | ||||||
| ``` | ||||||
                
      
                  lidezhu marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||||||
| 
     | 
||||||
| If you can confirm that the tables operated by TiDB Lightning Physical Import Mode do not overlap with the tables monitored by the changefeed, you can set the `check-requirements` in the TiDB Lightning configuration file to `false` to forcibly execute the data import operation. | ||||||
| 
     | 
||||||
| ## What are the compatibility limitations between BR (Backup & Restore) and TiCDC? | ||||||
                
      
                  lidezhu marked this conversation as resolved.
               
          
            Show resolved
            Hide resolved
         | 
||||||
| 
     | 
||||||
| BR (Backup & Restore) also directly generates SST files and imports them into the TiKV cluster. Changefeeds do not guarantee the ability to fully capture data imported in this manner. For details, refer to [What are the compatibility limitations between TiDB Lightning Physical Import Mode and TiCDC?](/ticdc/ticdc-faq.md#what-are-the-compatibility-limitations-between-tidb-lightning-physical-import-mode-and-ticdc). | ||||||
                
       | 
||||||
| BR (Backup & Restore) also directly generates SST files and imports them into the TiKV cluster. Changefeeds do not guarantee the ability to fully capture data imported in this manner. For details, refer to [What are the compatibility limitations between TiDB Lightning Physical Import Mode and TiCDC?](/ticdc/ticdc-faq.md#what-are-the-compatibility-limitations-between-tidb-lightning-physical-import-mode-and-ticdc). | |
| BR (Backup & Restore) also directly generates SST files and imports them into the TiKV cluster. Changefeeds cannot fully capture data imported in this manner. For details, refer to [What are the compatibility limitations between TiDB Lightning Physical Import Mode and TiCDC?](/ticdc/ticdc-faq.md#what-are-the-compatibility-limitations-between-tidb-lightning-physical-import-mode-and-ticdc). | 
        
          
              
                  lidezhu marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
                  lidezhu marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
                
          
              
                  hfxsd marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
                  hfxsd marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
                
          
              
                  lidezhu marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
                  lidezhu marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.