Revert "Wake up rcs when pods get DeletionFinalStateUnknown tombstones"

This commit is contained in:
Tim Hockin
2015-05-28 10:23:55 -07:00
parent 9b67435cf3
commit b69fad211e
6 changed files with 36 additions and 122 deletions

View File

@@ -22,8 +22,6 @@ import (
"sync"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
)
// NewDeltaFIFO returns a Store which can be used process changes to items.
@@ -78,13 +76,6 @@ func NewDeltaFIFO(keyFunc KeyFunc, compressor DeltaCompressor, knownObjectKeys K
// threads, you could end up with multiple threads processing slightly
// different versions of the same object.
//
// A note on the KeyLister used by the DeltaFIFO: It's main purpose is
// to list keys that are "known", for the puspose of figuring out which
// items have been deleted when Replace() is called. If the given KeyLister
// also satisfies the KeyGetter interface, the deleted objet will be
// included in the DeleteFinalStateUnknown markers. These objects
// could be stale.
//
// You may provide a function to compress deltas (e.g., represent a
// series of Updates as a single Update).
type DeltaFIFO struct {
@@ -343,21 +334,7 @@ func (f *DeltaFIFO) Replace(list []interface{}) error {
continue
}
}
var deletedObj interface{}
if keyGetter, ok := f.knownObjectKeys.(KeyGetter); ok {
var exists bool
var err error
deletedObj, exists, err = keyGetter.GetByKey(k)
if err != nil || !exists {
deletedObj = nil
if err != nil {
glog.Errorf("Unexpected error %v during lookup of key %v, placing DeleteFinalStateUnknown marker without object", err, k)
} else {
glog.Infof("Key %v does not exist in known objects store, placing DeleteFinalStateUnknown marker without object", k)
}
}
}
if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k, deletedObj}); err != nil {
if err := f.queueActionLocked(Deleted, DeletedFinalStateUnknown{k}); err != nil {
return err
}
}
@@ -369,9 +346,12 @@ type KeyLister interface {
ListKeys() []string
}
// A KeyGetter is anything that knows how to get the value stored under a given key.
type KeyGetter interface {
GetByKey(key string) (interface{}, bool, error)
// KeyListerFunc adapts a raw function to be a KeyLister.
type KeyListerFunc func() []string
// ListKeys just calls kl.
func (kl KeyListerFunc) ListKeys() []string {
return kl()
}
// DeltaCompressor is an algorithm that removes redundant changes.
@@ -447,10 +427,8 @@ func copyDeltas(d Deltas) Deltas {
}
// DeletedFinalStateUnknown is placed into a DeltaFIFO in the case where
// an object was deleted but the watch deletion event was missed. In this
// case we don't know the final "resting" state of the object, so there's
// a chance the included `Obj` is stale.
// an object was deleted but the watch deletion event was was missed.
// In this case we don't know the final "resting" state of the object.
type DeletedFinalStateUnknown struct {
Key string
Obj interface{}
}