Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve log readability for horaemeta #1501

Open
jiacai2050 opened this issue Mar 15, 2024 · 1 comment
Open

Improve log readability for horaemeta #1501

jiacai2050 opened this issue Mar 15, 2024 · 1 comment
Assignees
Labels
feature New feature or request

Comments

@jiacai2050
Copy link
Contributor

jiacai2050 commented Mar 15, 2024

Describe This Problem

This is what we get when meta log err message:

2024-03-15T10:16:16.439+0800 error procedure/util.go:35 open shard {"shardID": 231, "newLeaderNode": "11.69.60.125:8831", "error": "(#500)event dispatch failed, cause:open shard, addr:11.69.60.125:8831, request:{{231 1 10 0}}, err:fail to open shard, id:231. Caused by: Fail to open shard, msg:Shard is already in opening.\ngithub.com/apache/incubator-horaedb-meta/pkg/coderr.(*codeError).WithCausef\n\t/horaedb/horaemeta/pkg/coderr/error.go:91\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/eventdispatch.(*DispatchImpl).OpenShard\n\t/horaedb/horaemeta/server/coordinator/eventdispatch/dispatch_impl.go:58\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.openNewShardCallback\n\t/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/transfer_leader.go:272\ngithub.com/looplab/fsm.(*FSM).afterEventCallbacks\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:435\ngithub.com/looplab/fsm.(*FSM).Event.func1\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:330\ngithub.com/looplab/fsm.transitionerStruct.transition\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:375\ngithub.com/looplab/fsm.(*FSM).doTransition\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:360\ngithub.com/looplab/fsm.(*FSM).Event\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:343\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.(*Procedure).Start\n\t/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/transfer_leader.go:194\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.(*BatchTransferLeaderProcedure).Start.func1\n\t/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/batch_transfer_leader.go:115\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/root/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650\ngithub.com/apache/incubator-horaedb-meta/pkg/coderr.(*codeError).WithCausef\n\t/horaedb/horaemeta/pkg/coderr/error.go:91\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/eventdispatch.(*DispatchImpl).OpenShard\n\t/horaedb/horaemeta/server/coordinator/eventdispatch/dispatch_impl.go:58\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.openNewShardCallback\n\t/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/transfer_leader.go:272\ngithub.com/looplab/fsm.(*FSM).afterEventCallbacks\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:435\ngithub.com/looplab/fsm.(*FSM).Event.func1\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:330\ngithub.com/looplab/fsm.transitionerStruct.transition\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:375\ngithub.com/looplab/fsm.(*FSM).doTransition\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:360\ngithub.com/looplab/fsm.(*FSM).Event\n\t/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:343\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.(*Procedure).Start\n\t/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/transfer_leader.go:194\ngithub.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.(*BatchTransferLeaderProcedure).Start.func1\n\t/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/batch_transfer_leader.go:115\ngolang.org/x/sync/errgroup.(*Group).Go.func1\n\t/root/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:57\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1650"}
github.com/apache/incubator-horaedb-meta/server/coordinator/procedure.CancelEventWithLog
/horaedb/horaemeta/server/coordinator/procedure/util.go:35
github.com/apache/incubator-horaedb-meta/server/coordinator/procedure/operation/transferleader.openNewShardCallback
/horaedb/horaemeta/server/coordinator/procedure/operation/transferleader/transfer_leader.go:273
github.com/looplab/fsm.(*FSM).afterEventCallbacks
/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:435
github.com/looplab/fsm.(*FSM).Event.func1
/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:330
github.com/looplab/fsm.transitionerStruct.transition
/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:375
github.com/looplab/fsm.(*FSM).doTransition
/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:360
github.com/looplab/fsm.(*FSM).Event
/root/go/pkg/mod/github.com/looplab/[email protected]/fsm.go:343

Proposal

Break new line at \n

Additional Context

No response

@jiacai2050 jiacai2050 added the feature New feature or request label Mar 15, 2024
@ShiKaiWi
Copy link
Member

ShiKaiWi commented Mar 15, 2024

Here are my some ideas about this issue:

  • There is no need to include the call stack information in the error message
  • Format the call stack when logging

@ShiKaiWi ShiKaiWi self-assigned this Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants