Add expired tx logging #484

Merged
fyrchik merged 1 commits from dstepanov-yadro/frostfs-node:fix/notary_prep_logger into master 2023-07-03 08:03:26 +00:00

Relates #457

There were errors in the logs related to expired transactions. I want to add transaction logging for further investigation.

Relates https://git.frostfs.info/TrueCloudLab/frostfs-node/issues/457 There were errors in the logs related to expired transactions. I want to add transaction logging for further investigation.
dstepanov-yadro force-pushed fix/notary_prep_logger from 6f2990a9b0 to 1f91a5361c 2023-06-29 07:38:22 +00:00 Compare
dstepanov-yadro force-pushed fix/notary_prep_logger from 1f91a5361c to 82e69bdf0f 2023-06-29 07:41:05 +00:00 Compare
dstepanov-yadro requested review from storage-core-committers 2023-06-29 07:42:25 +00:00
dstepanov-yadro requested review from storage-core-developers 2023-06-29 07:42:25 +00:00
acid-ant approved these changes 2023-06-29 08:04:21 +00:00
aarifullin reviewed 2023-06-29 09:11:45 +00:00
@ -0,0 +12,4 @@
func (s *txStringer) String() string {
if s == nil {
return "stringer is null"
Collaborator

It means that we'll see in logs zapped message like

{ ..., "main_tx": "stringer is null", "fallback_tx": "transaction is null" ... }

Is it really convinient? For example, for message parsing.
I'd like to return just "null" or "nil" in both statements. WDYT?

It means that we'll see in logs zapped message like ``` { ..., "main_tx": "stringer is null", "fallback_tx": "transaction is null" ... } ``` Is it really convinient? For example, for message parsing. I'd like to return just "null" or "nil" in both statements. WDYT?

Is this line even reachable?

Is this line even reachable?
Poster
Collaborator

fixed

fixed
aarifullin approved these changes 2023-06-29 09:18:00 +00:00
fyrchik reviewed 2023-06-29 15:06:26 +00:00
@ -0,0 +17,4 @@
if s.tx == nil {
return "transaction is null"
}
data, err := s.tx.MarshalJSON()

Wow, this could be A LOT OF text, script size can reach 64 KiB. Do we need it?

Wow, this could be A LOT OF text, script size can reach 64 KiB. Do we need it?
Poster
Collaborator

Fixed logging. Now only heights will be logged, because .Hash() may cause panic, there is already unit test for this behaviour.

Fixed logging. Now only heights will be logged, because `.Hash()` may cause panic, there is already unit test for this behaviour.
fyrchik marked this conversation as resolved
dstepanov-yadro force-pushed fix/notary_prep_logger from 82e69bdf0f to 05c5ed3aa7 2023-06-30 06:40:57 +00:00 Compare
fyrchik reviewed 2023-06-30 12:45:02 +00:00
@ -370,3 +370,3 @@
case errors.Is(err, ErrMainTXExpired):
l.log.Warn(logs.EventSkipExpiredMainTXNotaryEvent,
zap.String("error", err.Error()),
zap.Error(err),

I believe initial reasons for using String were to avoid having stacktrace for not-so-rare warnings.
Anyway, seems unrelated to the commit, move?

I believe initial reasons for using `String` were to avoid having stacktrace for not-so-rare warnings. Anyway, seems unrelated to the commit, move?
Poster
Collaborator

ok, fixed

ok, fixed
@ -308,6 +318,10 @@ func (p Preparator) validateExpiration(fbTX *transaction.Transaction) error {
}
if currBlock >= nvb.Height {
p.logger.Warn(logs.MorphExpiredTransactionReceived,

We log sth here and in the parseAndHandleNotary. Why not just use fmt.Errorf with these heights?

We log sth here and in the `parseAndHandleNotary`. Why not just use `fmt.Errorf` with these heights?
Poster
Collaborator

fixed

fixed
dstepanov-yadro force-pushed fix/notary_prep_logger from 05c5ed3aa7 to 3bfba4b1e9 2023-06-30 13:30:00 +00:00 Compare
fyrchik merged commit 8d16d95376 into master 2023-07-03 08:03:26 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#484
There is no content yet.