Skip to content

Commit

Permalink
address the comment
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <disxiaofei@163.com>

address the comment

Signed-off-by: yisaer <disxiaofei@163.com>
  • Loading branch information
Yisaer committed Nov 28, 2022
1 parent c7b6250 commit b8e5712
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
11 changes: 2 additions & 9 deletions planner/core/find_best_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -392,13 +392,6 @@ func (p *baseLogicalPlan) findBestTask(prop *property.PhysicalProperty, planCoun
// prop should be read only because its cached hashcode might be not consistent
// when it is changed. So we clone a new one for the temporary changes.
newProp := prop.CloneEssentialFields()
if _, ok := p.self.(*LogicalLock); ok {
newProp.InLock = true
defer func() {
newProp.InLock = false
}()
}

var plansFitsProp, plansNeedEnforce []PhysicalPlan
var hintWorksWithProp bool
// Maybe the plan can satisfy the required property,
Expand Down Expand Up @@ -921,8 +914,8 @@ func (ds *DataSource) findBestTask(prop *property.PhysicalProperty, planCounter
}

// if the path is the point get range path with for update lock, we should forbid tiflash as it's store path.
if path.StoreType == kv.TiFlash {
if ds.isPointGetPath(path) && prop.InLock {
if path.StoreType == kv.TiFlash && ds.isPointGetPath(path) {
if _, ok := ds.ctx.GetSessionVars().StmtCtx.LockTableIDs[ds.table.Meta().ID]; ok {
continue
}
}
Expand Down
4 changes: 0 additions & 4 deletions planner/property/physical_property.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ type PhysicalProperty struct {
// RejectSort means rejecting the sort property from its children, but it only works for MPP tasks.
// Non-MPP tasks do not care about it.
RejectSort bool

// InLock indicates the Plan is under LogicalLock
InLock bool
}

// NewPhysicalProperty builds property from columns.
Expand Down Expand Up @@ -351,7 +348,6 @@ func (p *PhysicalProperty) CloneEssentialFields() *PhysicalProperty {
MPPPartitionTp: p.MPPPartitionTp,
MPPPartitionCols: p.MPPPartitionCols,
RejectSort: p.RejectSort,
InLock: p.InLock,
}
return prop
}
Expand Down

0 comments on commit b8e5712

Please sign in to comment.