Skip to content

Commit

Permalink
Merge branch 'master' into ppc64le_build
Browse files Browse the repository at this point in the history
  • Loading branch information
Pensu authored Mar 9, 2020
2 parents 090e825 + b620bdc commit c7676df
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions app/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ func startController(c *cli.Context) error {
}
logrus.Infof("Starting controller with frontendIP: %v, and clusterIP: %v", tgt.FrontendIP, tgt.ClusterIP)

startAutoSnapDeletion := make(chan bool)
//startAutoSnapDeletion := make(chan bool)
control := controller.
NewController(
startAutoSnapDeletion,
// startAutoSnapDeletion,
controller.WithName(name),
controller.WithClusterIP(tgt.ClusterIP),
controller.WithBackend(dynamic.New(
Expand All @@ -136,11 +136,11 @@ func startController(c *cli.Context) error {
controller.WithRF(int(rf)))
server := rest.NewServer(control)
router := http.Handler(rest.NewRouter(server))
go func(c *controller.Controller) {
for <-startAutoSnapDeletion {
go autoDeleteSnapshot(c)
}
}(control)
// go func(c *controller.Controller) {
// for <-startAutoSnapDeletion {
// go autoDeleteSnapshot(c)
// }
// }(control)

router = util.FilteredLoggingHandler(map[string]struct{}{
"/v1/volumes": {},
Expand Down Expand Up @@ -252,6 +252,6 @@ func autoDeleteSnapshot(c *controller.Controller) error {
// if no of snapshots are greater than 10
// this function will start deleting the snapshots
// but if it's less then 10 goroutine will be exited
c.StartAutoSnapDeletion <- true
//c.StartAutoSnapDeletion <- true
return nil
}
8 changes: 4 additions & 4 deletions ci/start_init_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2079,7 +2079,7 @@ fi

# currently integration tests are run only for amd64
if [ "$ARCH" != "linux_amd64" ]; then
echo "skipping test for $ARCH"
echo "skipping test for $ARCH"
exit 0
fi

Expand All @@ -2102,10 +2102,10 @@ test_restart_during_prepare_rebuild
test_preload
test_replica_rpc_close
test_controller_rpc_close
test_replication_factor
#test_replication_factor
#test_two_replica_delete
test_replica_ip_change
test_replica_reregistration
#test_replica_ip_change
#test_replica_reregistration
run_data_integrity_test_with_fs_creation
test_clone_feature
test_duplicate_snapshot_failure
Expand Down
6 changes: 3 additions & 3 deletions controller/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type Controller struct {
ReadOnly bool
SnapshotName string
IsSnapDeletionInProgress bool
StartAutoSnapDeletion chan bool
//StartAutoSnapDeletion chan bool
}

func max(x int, y int) int {
Expand Down Expand Up @@ -98,13 +98,13 @@ func WithClusterIP(ip string) BuildOpts {
}

// NewController instantiates a new Controller
func NewController(ch chan bool, opts ...BuildOpts) *Controller {
func NewController(opts ...BuildOpts) *Controller {
c := &Controller{
RegisteredReplicas: map[string]types.RegReplica{},
RegisteredQuorumReplicas: map[string]types.RegReplica{},
StartTime: time.Now(),
ReadOnly: true,
StartAutoSnapDeletion: ch,
//StartAutoSnapDeletion: ch,
}

for _, o := range opts {
Expand Down
2 changes: 1 addition & 1 deletion controller/rebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func (c *Controller) VerifyRebuildReplica(address string) error {
c.quorumReplicaCount = len(c.quorumReplicas)
}
c.UpdateVolStatus()
c.StartAutoSnapDeletion <- true
//c.StartAutoSnapDeletion <- true
return nil
}

Expand Down
16 changes: 8 additions & 8 deletions sync/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,16 +388,16 @@ func (t *Task) syncFiles(fromClient, toClient *replicaClient.ReplicaClient, disk
return fmt.Errorf("Disk list shouldn't contain volume-head")
}

ok, err := isRevisionCountSame(fromClient, toClient, disk)
if err != nil {
/* ok, err := isRevisionCountSame(fromClient, toClient, disk)
if err != nil {
return err
}
*/
// if !ok {
if err := t.syncFile(disk, "", fromClient, toClient); err != nil {
return err
}

if !ok {
if err := t.syncFile(disk, "", fromClient, toClient); err != nil {
return err
}
}
// }
if err := t.syncFile(disk+".meta", "", fromClient, toClient); err != nil {
return err
}
Expand Down

0 comments on commit c7676df

Please sign in to comment.