Skip to content
This repository has been archived by the owner on Aug 21, 2023. It is now read-only.

export: don't +1 TSO when set GC safepoint #290

Merged
merged 3 commits into from
Jul 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion v4/export/sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -967,7 +967,7 @@ func parseSnapshotToTSO(pool *sql.DB, snapshot string) (uint64, error) {
if !tso.Valid {
return 0, errors.Errorf("snapshot %s format not supported. please use tso or '2006-01-02 15:04:05' format time", snapshot)
}
return (uint64(tso.Int64)<<18)*1000 + 1, nil
return (uint64(tso.Int64) << 18) * 1000, nil
}

func buildWhereCondition(conf *Config, where string) string {
Expand Down
2 changes: 1 addition & 1 deletion v4/export/sql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ func (s *testSQLSuite) TestParseSnapshotToTSO(c *C) {
WillReturnRows(sqlmock.NewRows([]string{`unix_timestamp("2020/07/18 20:31:50")`}).AddRow(1595075510))
tso, err := parseSnapshotToTSO(db, snapshot)
c.Assert(err, IsNil)
c.Assert(tso, Equals, (unixTimeStamp<<18)*1000+1)
c.Assert(tso, Equals, (unixTimeStamp<<18)*1000)
c.Assert(mock.ExpectationsWereMet(), IsNil)

// generate columns not valid snapshot
Expand Down