| 843 | } |
| 844 | |
| 845 | func updateStartTs(p *pb.Proposal) { |
| 846 | switch { |
| 847 | case p.Mutations != nil: |
| 848 | p.StartTs = p.Mutations.StartTs |
| 849 | case p.Snapshot != nil: |
| 850 | p.StartTs = p.Snapshot.ReadTs |
| 851 | case p.Delta != nil: |
| 852 | p.StartTs = 0 // Run this asap. |
| 853 | case len(p.CleanPredicate) > 0 && p.StartTs == 0: |
| 854 | // proposal.StartTs did not exist earlier. So, it would be zero when reading an old |
| 855 | // proposal. This startTs is used for writing the schema. |
| 856 | // Hence, use the ts=1 for such proposals. |
| 857 | p.StartTs = 1 |
| 858 | default: |
| 859 | // For now, not covering everything. |
| 860 | } |
| 861 | } |
| 862 | |
| 863 | func (n *node) processApplyCh() { |
| 864 | defer n.closer.Done() // CLOSER:1 |