Skip to content

Round-robin updateMember may cause the timestamp to fallback #6770

@JmPotato

Description

@JmPotato

Bug Report

We use a round-robin way to request the TSO server with FindGroupByKeyspaceID gRPC call.

func (c *tsoServiceDiscovery) updateMember() error {
// The keyspace membership or the primary serving address of the keyspace group, to which this
// keyspace belongs, might have been changed. We need to query tso servers to get the latest info.
tsoServerAddr, err := c.getTSOServer(c.apiSvcDiscovery)
if err != nil {
log.Error("[tso] failed to get tso server", errs.ZapError(err))
return err
}
keyspaceID := c.GetKeyspaceID()
var keyspaceGroup *tsopb.KeyspaceGroup
if len(tsoServerAddr) > 0 {
keyspaceGroup, err = c.findGroupByKeyspaceID(keyspaceID, tsoServerAddr, updateMemberTimeout)
if err != nil {
if c.tsoServerDiscovery.countFailure() {
log.Error("[tso] failed to find the keyspace group",
zap.Uint32("keyspace-id-in-request", keyspaceID),
zap.String("tso-server-addr", tsoServerAddr),
errs.ZapError(err))
}
return err
}
c.tsoServerDiscovery.resetFailure()
} else {

However, if the requested TSO server satisfies this kind of case, it may cause the timestamp to fallback.

  • TSO node A initialized group 1.
  • TSO node B has not initialized group 1 yet.

If we do updateMember quickly while requesting the TSO, it may cause the keyspace group in the request to change between the default group and group 1, resulting in the timestamp fallback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    affects-7.1This bug affects the 7.1.x(LTS) versions.affects-7.5This bug affects the 7.5.x(LTS) versions.affects-8.1This bug affects the 8.1.x(LTS) versions.affects-8.5This bug affects the 8.5.x(LTS) versions.component/clientClient logic.component/keyspaceKey space.component/tsoTimestamp Oracle.report/customerCustomers have encountered this bug.severity/majortype/bugThe issue is confirmed as a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions