mirror of
https://github.com/logos-messaging/storenode-messages-counter.git
synced 2026-01-05 23:53:10 +00:00
test: more logs
This commit is contained in:
parent
1c390072f1
commit
73a5e9cfdb
@ -4,7 +4,6 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
@ -285,10 +284,9 @@ func retrieveHistory(ctx context.Context, runId string, storenodes []peer.AddrIn
|
|||||||
var result *store.Result
|
var result *store.Result
|
||||||
var err error
|
var err error
|
||||||
|
|
||||||
logger.Info("retrieving message history for topic", zap.Stringer("storenode", node), zap.Int64("from", startTime.UnixNano()), zap.Int64("to", endTime.UnixNano()))
|
|
||||||
|
|
||||||
queryLbl:
|
queryLbl:
|
||||||
for i := 0; i < maxAttempts; i++ {
|
for i := 0; i < maxAttempts; i++ {
|
||||||
|
logger.Info("retrieving message history for topic", zap.Stringer("storenode", node), zap.Int64("from", startTime.UnixNano()), zap.Int64("to", endTime.UnixNano()), zap.Int("attempt", i))
|
||||||
result, err = wakuNode.Store().Query(ctx, store.FilterCriteria{
|
result, err = wakuNode.Store().Query(ctx, store.FilterCriteria{
|
||||||
ContentFilter: protocol.NewContentFilter(topic),
|
ContentFilter: protocol.NewContentFilter(topic),
|
||||||
TimeStart: proto.Int64(startTime.UnixNano()),
|
TimeStart: proto.Int64(startTime.UnixNano()),
|
||||||
@ -345,8 +343,7 @@ func retrieveHistory(ctx context.Context, runId string, storenodes []peer.AddrIn
|
|||||||
|
|
||||||
nextRetryLbl:
|
nextRetryLbl:
|
||||||
for i := 0; i < maxAttempts; i++ {
|
for i := 0; i < maxAttempts; i++ {
|
||||||
a, _ := json.Marshal(result.Response())
|
logger.Info("EXECUTING NEXT!!!", zap.String("cursor", hex.EncodeToString(result.Cursor())))
|
||||||
logger.Info("EXECUTING NEXT!!!", zap.String("cursor", hex.EncodeToString(result.Cursor())), zap.String("RESPONSE", string(a)))
|
|
||||||
err = result.Next(ctx)
|
err = result.Next(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("could not query storenode", zap.Stringer("storenode", node), zap.Error(err))
|
logger.Error("could not query storenode", zap.Stringer("storenode", node), zap.Error(err))
|
||||||
@ -392,7 +389,8 @@ func verifyMessageExistence(ctx context.Context, runId string, peerID peer.ID, m
|
|||||||
|
|
||||||
queryLbl:
|
queryLbl:
|
||||||
for i := 0; i < maxAttempts; i++ {
|
for i := 0; i < maxAttempts; i++ {
|
||||||
result, err = wakuNode.Store().QueryByHash(ctx, messageHashes, store.IncludeData(false), store.WithPeer(peerInfo.ID))
|
logger.Info("querying by hash", zap.Stringer("storenode", peerID), zap.Stringers("hashes", messageHashes), zap.Int("attempt", i))
|
||||||
|
result, err = wakuNode.Store().QueryByHash(ctx, messageHashes, store.IncludeData(false), store.WithPeer(peerInfo.ID), store.WithPaging(false, 100))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("could not query storenode", zap.Stringer("storenode", peerInfo), zap.Error(err))
|
logger.Error("could not query storenode", zap.Stringer("storenode", peerInfo), zap.Error(err))
|
||||||
storeNodeFailure = true
|
storeNodeFailure = true
|
||||||
@ -436,6 +434,7 @@ queryLbl:
|
|||||||
|
|
||||||
nextRetryLbl:
|
nextRetryLbl:
|
||||||
for i := 0; i < maxAttempts; i++ {
|
for i := 0; i < maxAttempts; i++ {
|
||||||
|
logger.Info("executing next while querying hashes", zap.Stringer("storenode", peerID), zap.Int("attempt", i))
|
||||||
err = result.Next(ctx)
|
err = result.Next(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Error("could not query storenode", zap.Stringer("storenode", peerInfo), zap.Error(err))
|
logger.Error("could not query storenode", zap.Stringer("storenode", peerInfo), zap.Error(err))
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user