# Influx Plugin: Data loss during Output server down-time

**URL:** https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624
**Category:** Logstash
**Created:** [May 25, 2022, 2:59pm UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624 "2022-05-25T14:59:27Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![AurelioAranzana](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AurelioAranzana](https://discuss.elastic.co/u/AurelioAranzana)
#### Post date: [May 25, 2022, 2:59pm UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/1 "2022-05-25T14:59:27Z")

</div>

Hi everyone!  
I would like to know how Logstash handles when your output server is down.  
In my case, I'm using the Influxdb output plugin.  
From what I'm seeing it will keep trying according to the max\_retries parameter, but I don't know if configuring it to retry indefinitely could block logstash since my pipelines are triggered every minute .  
This makes me think that the data will be lost even though we use a persistent queue configuration since the Influx Connection error is not native to logstash and it seems that no ACK signal is sent.

Could anyone confirm for me what will happen?

Thank you very much  
Aurelio

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 25, 2022, 4:08pm UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/2 "2022-05-25T16:08:42Z")

</div>

logstash has an at-least-once delivery model. It will queue events, either in-memory or in a persistent queue. If the queues fill up it will stop reading the inputs.

---

<div class="post-metadata">

### Author: ![AurelioAranzana](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AurelioAranzana](https://discuss.elastic.co/u/AurelioAranzana)
#### Post date: [May 26, 2022, 8:25am UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/3 "2022-05-26T08:25:50Z")

</div>

Thank you very much for your answer

But in order to ensure that data is delivered, should I set the number of retries to infinite?  
At the moment, when we reach the maximum number of retries, we would obtain a warning rather than an ERROR. So I don't know if Logstash will guarantee "at-least-once delivery" in this situation

```auto
[WARN][logstash.outputs.influxdc][pipeline_id]Connection Error while writint to InfluxDB {:exception=>#InfluxDB::ConnectionError: Tried 3 times to reconnect but failed.>}

```

Moreover, will this action impact the performance of Logstash?

---

<div class="post-metadata">

### Author: ![AurelioAranzana](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AurelioAranzana](https://discuss.elastic.co/u/AurelioAranzana)
#### Post date: [May 26, 2022, 11:13am UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/4 "2022-05-26T11:13:36Z")

</div>

I have continued testing where my inputs come from querying a MySQL Server and I found:

1. As you said, if the queues fill up it will stop reading inputs.  
2)If the initial input events fill up the queue, the pipeline will freeze just providing partial results. It won't continue event thought partial events has been processed
2. Retries to export data to influx are scheduled according to the next sequence: 2s,4s,8s,16s,30s,30s...

However, if Logstash is trying to export data to influx during Influx Server restart, the pipeline will die and won't be restarted. Any suggestion?

```auto
[2022-05-26T10:32:38,760][WARN][logstash.outputs.influxdb][pipeline_id][plugin_id] Connection Error while writing to InfluxDB {:exception=>#<InfluxDB::ConnectionError: The server has sent incomplete data (insufficient resources are a possible cause).>}
logstash    

```

```auto
[2022-05-26T10:32:40,781][WARN][logstash.outputs.influxdb][pipeline_id][plugin_id] Non recoverable exception while writing to InfluxDB {:exception=>#<Errno::EPIPE: Broken pipe - No message available>}

```

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [May 26, 2022, 4:48pm UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/5 "2022-05-26T16:48:53Z")

</div>

> [@AurelioAranzana](#):
>
> Any suggestion?

No, I am not familiar with what the InfluxDB client considers retryable.

---

<div class="post-metadata">

### Author: ![AurelioAranzana](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@AurelioAranzana](https://discuss.elastic.co/u/AurelioAranzana)
#### Post date: [May 26, 2022, 5:06pm UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/6 "2022-05-26T17:06:17Z")

</div>

I have continued testing and Logstash will exit, meaning data will be lost, in two situations:  
-It arrives at the maximum limit of retries, considering it a valid outcome since it was designed for it. (Solvable erasing the limit+Persisten Queue)  
-Connection has been established, but Influx didn't manage to ingest the data.

The second point happened to me when I restarted the Influx server simultaneously with one of these retries. Logstash has stored the logs presented in my previous comment and exited. However, Influx has kept just partial information.

I don't know how to solve this situation. Any idea?

P.D. The pipeline froze on my previous post because I configured queue--page\_capacity bigger than queue.max\_bytes, so the queue wasn't flushed properly.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [June 23, 2022, 5:06pm UTC](https://discuss.elastic.co/t/influx-plugin-data-loss-during-output-server-down-time/305624/7 "2022-06-23T17:06:18Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
