Skip to content

Commit

Permalink
Bugfix: we address hosts using string(rune(shardID)), not by
Browse files Browse the repository at this point in the history
itoa(shardD)

I wish it be the other way, but we can't change how it works now since
in all the other places we already use rune(shardID).
This was not a critical issue - we just returned ShardOwnershipLostError
with bad target host in very specific cases. For instance, at the
persistence engine error - when we got an error from transaction.
  • Loading branch information
dkrotx committed Apr 29, 2024
1 parent 969a6c6 commit 45f0150
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions service/history/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1962,7 +1962,7 @@ func (h *handlerImpl) GetCrossClusterTasks(
if err != nil {
logger.Error("History engine not found for shard", tag.Error(err))
var owner membership.HostInfo
if info, err := h.GetMembershipResolver().Lookup(service.History, strconv.Itoa(int(shardID))); err == nil {
if info, err := h.GetMembershipResolver().Lookup(service.History, string(rune(shardID))); err == nil {
owner = info
}
settable.Set(nil, shard.CreateShardOwnershipLostError(h.GetHostInfo(), owner))
Expand Down Expand Up @@ -2069,7 +2069,7 @@ func (h *handlerImpl) RatelimitUpdate(
func (h *handlerImpl) convertError(err error) error {
switch err := err.(type) {
case *persistence.ShardOwnershipLostError:
info, err2 := h.GetMembershipResolver().Lookup(service.History, strconv.Itoa(err.ShardID))
info, err2 := h.GetMembershipResolver().Lookup(service.History, string(rune(err.ShardID)))
if err2 != nil {
return shard.CreateShardOwnershipLostError(h.GetHostInfo(), membership.HostInfo{})
}
Expand Down

0 comments on commit 45f0150

Please sign in to comment.