Signed-off-by: changlin.shi <changlin.shi@ly.com>
@ -232,3 +232,8 @@ func (r *BucketRegistry) unMarkNotFound(bucket string) {
defer r.notFoundLock.Unlock()
delete(r.notFound, bucket)
}
func (r *BucketRegistry) ClearCache(bucket string) {
r.removeMetadataCache(bucket)
r.unMarkNotFound(bucket)
@ -153,6 +153,10 @@ func (s3a *S3ApiServer) PutBucketHandler(w http.ResponseWriter, r *http.Request)
s3err.WriteErrorResponse(w, r, s3err.ErrInternalError)
return
// clear cache
s3a.bucketRegistry.ClearCache(bucket)
w.Header().Set("Location", "/"+bucket)
writeSuccessResponseEmpty(w, r)