Skip to content

Could it fail fast on the propose dropping while leader changed #8975

@absolute8511

Description

@absolute8511

While leader is transferred, the proposal may be dropped. But we can not get the notify so we can do some retry work.
For example, as below

https://github.com/coreos/etcd/blob/b041ce5d514a4b4aaeefbffb008f0c7570a18986/etcdserver/v3_server.go#L572

	cctx, cancel := context.WithTimeout(ctx, s.Cfg.ReqTimeout())
	defer cancel()

	start := time.Now()
	s.r.Propose(cctx, data)
	proposalsPending.Inc()
	defer proposalsPending.Dec()

	select {
	case x := <-ch:
		return x.(*applyResult), nil
	case <-cctx.Done():
		proposalsFailed.Inc()
		s.w.Trigger(id, nil) // GC wait
		return nil, s.parseProposeCtxErr(cctx.Err(), start)
	case <-s.done:
		return nil, ErrStopped
	}

We just wait context timeout to get to know we failed to propose which is blocking too long. I think we should handle the proposal dropping event to fail fast. One possible way is to wake up the cctx.Done while dropping proposal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions