Skip to content

Commit

Permalink
sql: check the expiration time of a table descriptor is valid
Browse files Browse the repository at this point in the history
related to #24930

Release note: None
  • Loading branch information
vivekmenezes committed May 3, 2018
1 parent 4a36c2b commit 5d205ed
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/sql/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,10 @@ func (tc *TableCollection) getTableVersion(
return nil, nil, err
}

if !origTimestamp.Less(expiration) {
log.Fatalf(ctx, "bad table for T=%s, expiration=%s", origTimestamp, expiration)
}

tc.leasedTables = append(tc.leasedTables, table)
log.VEventf(ctx, 2, "added table '%s' to table collection", tn)

Expand Down Expand Up @@ -341,6 +345,10 @@ func (tc *TableCollection) getTableVersionByID(
return nil, err
}

if !origTimestamp.Less(expiration) {
log.Fatalf(ctx, "bad table for T=%s, expiration=%s", origTimestamp, expiration)
}

tc.leasedTables = append(tc.leasedTables, table)
log.VEventf(ctx, 2, "added table '%s' to table collection", table.Name)

Expand Down

0 comments on commit 5d205ed

Please sign in to comment.