mirror of
https://github.com/0glabs/0g-storage-node.git
synced 2024-11-10 10:05:17 +00:00
Enhance log level (#103)
* reduce default find peers timeout for auto sync * opt log level to avoid too many noisy info logs
This commit is contained in:
parent
055d1fa32d
commit
5bc5bbd696
@ -243,7 +243,7 @@ impl Libp2pEventHandler {
|
|||||||
id: &MessageId,
|
id: &MessageId,
|
||||||
message: PubsubMessage,
|
message: PubsubMessage,
|
||||||
) -> MessageAcceptance {
|
) -> MessageAcceptance {
|
||||||
info!(?message, %propagation_source, %source, %id, "Received pubsub message");
|
trace!(?message, %propagation_source, %source, %id, "Received pubsub message");
|
||||||
|
|
||||||
match message {
|
match message {
|
||||||
PubsubMessage::ExampleMessage(_) => MessageAcceptance::Ignore,
|
PubsubMessage::ExampleMessage(_) => MessageAcceptance::Ignore,
|
||||||
|
@ -28,8 +28,8 @@ impl Default for Config {
|
|||||||
fn default() -> Self {
|
fn default() -> Self {
|
||||||
Self {
|
Self {
|
||||||
auto_sync_enabled: false,
|
auto_sync_enabled: false,
|
||||||
max_sync_files: 100,
|
max_sync_files: 8,
|
||||||
find_peer_timeout: Duration::from_secs(30),
|
find_peer_timeout: Duration::from_secs(10),
|
||||||
sync_file_by_rpc_enabled: true,
|
sync_file_by_rpc_enabled: true,
|
||||||
sync_file_on_announcement_enabled: false,
|
sync_file_on_announcement_enabled: false,
|
||||||
}
|
}
|
||||||
|
@ -345,7 +345,7 @@ impl SyncService {
|
|||||||
request_id: PeerRequestId,
|
request_id: PeerRequestId,
|
||||||
request: GetChunksRequest,
|
request: GetChunksRequest,
|
||||||
) {
|
) {
|
||||||
info!(?request, %peer_id, ?request_id, "Received GetChunks request");
|
debug!(?request, %peer_id, ?request_id, "Received GetChunks request");
|
||||||
|
|
||||||
if let Err(err) = self
|
if let Err(err) = self
|
||||||
.handle_chunks_request_with_db_err(peer_id, request_id, request)
|
.handle_chunks_request_with_db_err(peer_id, request_id, request)
|
||||||
@ -459,7 +459,7 @@ impl SyncService {
|
|||||||
request_id: RequestId,
|
request_id: RequestId,
|
||||||
response: ChunkArrayWithProof,
|
response: ChunkArrayWithProof,
|
||||||
) {
|
) {
|
||||||
info!(%response.chunks, %peer_id, ?request_id, "Received chunks response");
|
debug!(%response.chunks, %peer_id, ?request_id, "Received chunks response");
|
||||||
|
|
||||||
let tx_seq = match request_id {
|
let tx_seq = match request_id {
|
||||||
RequestId::SerialSync { tx_id } => tx_id.seq,
|
RequestId::SerialSync { tx_id } => tx_id.seq,
|
||||||
@ -604,7 +604,7 @@ impl SyncService {
|
|||||||
|
|
||||||
async fn on_announce_file_gossip(&mut self, tx_id: TxID, peer_id: PeerId, addr: Multiaddr) {
|
async fn on_announce_file_gossip(&mut self, tx_id: TxID, peer_id: PeerId, addr: Multiaddr) {
|
||||||
let tx_seq = tx_id.seq;
|
let tx_seq = tx_id.seq;
|
||||||
info!(%tx_seq, %peer_id, %addr, "Received AnnounceFile gossip");
|
debug!(%tx_seq, %peer_id, %addr, "Received AnnounceFile gossip");
|
||||||
|
|
||||||
self.manager.update_on_announcement(tx_seq).await;
|
self.manager.update_on_announcement(tx_seq).await;
|
||||||
|
|
||||||
@ -644,7 +644,7 @@ impl SyncService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn on_announce_chunks_gossip(&mut self, msg: AnnounceChunks) {
|
async fn on_announce_chunks_gossip(&mut self, msg: AnnounceChunks) {
|
||||||
info!(?msg, "Received AnnounceChunks gossip");
|
debug!(?msg, "Received AnnounceChunks gossip");
|
||||||
|
|
||||||
if let Some(controller) = self.controllers.get_mut(&msg.tx_id.seq) {
|
if let Some(controller) = self.controllers.get_mut(&msg.tx_id.seq) {
|
||||||
let info = controller.get_sync_info();
|
let info = controller.get_sync_info();
|
||||||
|
@ -230,7 +230,7 @@ miner_key = ""
|
|||||||
|
|
||||||
# Timeout to terminate a file sync when automatically sync from other peers.
|
# Timeout to terminate a file sync when automatically sync from other peers.
|
||||||
# If timeout, terminated file sync will be triggered later.
|
# If timeout, terminated file sync will be triggered later.
|
||||||
# find_peer_timeout = "30s"
|
# find_peer_timeout = "10s"
|
||||||
|
|
||||||
# Enable to start a file sync via RPC (e.g. `admin_startSyncFile`).
|
# Enable to start a file sync via RPC (e.g. `admin_startSyncFile`).
|
||||||
# sync_file_by_rpc_enabled = true
|
# sync_file_by_rpc_enabled = true
|
||||||
|
Loading…
Reference in New Issue
Block a user