Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1846094

Summary: [Logging 4.5] fluentd gets wedged/stops sending to ES at moderately high rates with latest images
Product: OpenShift Container Platform Reporter: Mike Fiedler <mifiedle>
Component: LoggingAssignee: Jeff Cantrill <jcantril>
Status: CLOSED NOTABUG QA Contact: Anping Li <anli>
Severity: high Docs Contact:
Priority: unspecified    
Version: 4.5CC: aos-bugs, ematysek, periklis
Target Milestone: ---Keywords: Regression, UpcomingSprint
Target Release: 4.6.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1846174 (view as bug list) Environment:
Last Closed: 2020-07-07 19:55:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1846174    

Description Mike Fiedler 2020-06-10 18:22:38 UTC
Description of problem:

While logging at moderately high rates in 4.5 with the latest downstream images, fluentd is consistently getting stuck not being able to send messages to elasticsearch.   Messages flow for a while and then fluentd gets this pair of messages in the pod log:

2020-06-10 15:56:59 +0000 [warn]: [clo_default_output_es] failed to write data into buffer by buffer overflow action=:block                                                                                                                                   
2020-06-10 15:57:00 +0000 [warn]: [clo_default_output_es] failed to write data into buffer by buffer overflow action=:block 

Checking /var/lib/fluentd/clo_default_output_es shows the cache has 49 files and is not draining even after all pod logging activity has finished.   Stopping and restarting fluentd after pod logging activity has finished does not work either - the cached messages remain on fluentd and are never indexed.

This was not seen earlier in 4.5 scalability tests.

Elasticsearch does not seem to be in any distress.   There are no rejected requests:

host       name                rejected completed queue size active largest
10.131.2.4 analyze                    0         0     0    0      0       0
10.131.2.4 fetch_shard_started        0         0     0    0      0       0
10.131.2.4 fetch_shard_store          0         0     0    0      0       0
10.131.2.4 flush                      0        62     0    1      0       4
10.131.2.4 force_merge                0         0     0    0      0       0
10.131.2.4 generic                    0      3425     0    4      0       4
10.131.2.4 get                        0      2720     0   26      0      26
10.131.2.4 index                      0         0     0    0      0       0
10.131.2.4 listener                   0         0     0    0      0       0
10.131.2.4 management                 0     35815     0    4      1       4
10.131.2.4 refresh                    0     20709     0    2      0       2
10.131.2.4 search                     0         0     0    0      0       0
10.131.2.4 search_throttled           0         0     0    0      0       0
10.131.2.4 snapshot                   0         0     0    0      0       0
10.131.2.4 warmer                     0      6742     0    1      0       5
10.131.2.4 write                      0     33355     0   26      0      26
10.130.2.5 analyze                    0         0     0    0      0       0
10.130.2.5 fetch_shard_started        0         0     0    0      0       0
10.130.2.5 fetch_shard_store          0         0     0    0      0       0
10.130.2.5 flush                      0        64     0    1      0       4
10.130.2.5 force_merge                0         0     0    0      0       0
10.130.2.5 generic                    0     12762     0    4      0       4
10.130.2.5 get                        0      2722     0   26      0      26
10.130.2.5 index                      0         0     0    0      0       0
10.130.2.5 listener                   0         0     0    0      0       0
10.130.2.5 management                 0     35381     0    4      1       4
10.130.2.5 refresh                    0     29744     0    2      0       2
10.130.2.5 search                     0         0     0    0      0       0
10.130.2.5 search_throttled           0         0     0    0      0       0
10.130.2.5 snapshot                   0         0     0    0      0       0
10.130.2.5 warmer                     0      6782     0    1      0       5
10.130.2.5 write                      0     33241     0   26      0      26
10.128.4.4 analyze                    0         0     0    0      0       0
10.128.4.4 fetch_shard_started        0         0     0    0      0       0
10.128.4.4 fetch_shard_store          0         0     0    0      0       0
10.128.4.4 flush                      0        62     0    1      0       3
10.128.4.4 force_merge                0         0     0    0      0       0
10.128.4.4 generic                    0     12583     0    4      0       4
10.128.4.4 get                        0         0     0    0      0       0
10.128.4.4 index                      0         0     0    0      0       0
10.128.4.4 listener                   0         0     0    0      0       0
10.128.4.4 management                 0     34620     0    4      1       4
10.128.4.4 refresh                    0     20702     0    2      0       2
10.128.4.4 search                     0         0     0    0      0       0
10.128.4.4 search_throttled           0         0     0    0      0       0
10.128.4.4 snapshot                   0         0     0    0      0       0
10.128.4.4 warmer                     0      6749     0    1      0       5
10.128.4.4 write                      0     33218     0   26      0      26



Version-Release number of selected component (if applicable):

CLO:  4.5.0-202006090812
ESO:  4.5.0-202006091957
Elasticsearch:  quay.io/openshift-qe-optional-operators/ose-logging-elasticsearch6@sha256:4247936f4a2aa22c55862fb9dc4efd34373a713f9d904376c7d77a9322cf9c4e
fluentd: quay.io/openshift-qe-optional-operators/ose-logging-fluentd@sha256:b5bdc43631734a4c7203483d6fd3a338729852b17e64995533f7f777f692601f




How reproducible: Always for this workload


Steps to Reproduce:
1. Install logging with above downstream ART-built images.   
   - ES cluster is 3x m8.xlarge (32 vCPU, 128Gi memory) instances on AWS.
   - ES pods have a request for 26 CPU and 61Gi memory
   - 9 worker nodes
2. Generate logging traffic
   - 180 projects each with 1 pod (20 pods/node)
   - Each pod generates 75 1KB messages/second (aggregate for cluster is 13,500 messages/second which is well within previously tested limits, even in 4.5)
   - 
3. Watch the indices and the fluentd cache directories.   

Actual results:

After a while, indices stop growing even though pods are still logging and fluentd cache fills up.   eventually fluentd pod logs are:

  2020-06-10 15:28:36 +0000 [warn]: suppressed same stacktrace
2020-06-10 15:28:39 +0000 [warn]: [clo_default_output_es] retry succeeded. chunk_id="5a7bc773b131c984c42dbda9320fcf93"
2020-06-10 17:02:29 +0000 [warn]: [clo_default_output_es] failed to write data into buffer by buffer overflow action=:block
2020-06-10 17:02:30 +0000 [warn]: [clo_default_output_es] failed to write data into buffer by buffer overflow action=:block

see the log for fluentd-7hjq9.log in the referenced logs for an example.

Additional info:

In a private comment, will provide a tar with:
  - oc adm must-gather
  - all ES pod logs
  - all fluentd pod logs
  - clusterlogging and elasticsearch yaml

Please let me know what else is required.   I will pause my cluster due to cost of 8xlarge instances, but can resume it when needed.  Ping on Slack for access.

Comment 2 Jeff Cantrill 2020-06-10 19:27:01 UTC
Peri,

This may be related to the correction of the buffers you merged based on:

2020-06-10 17:02:29 +0000 [warn]: [clo_default_output_es] failed to write data into buffer by buffer overflow action=:block
2020-06-10 17:02:30 +0000 [warn]: [clo_default_output_es] failed to write data into buffer by buffer overflow action=:block

Since the logs are not getting pushed maybe we are bumping into some backoff (e.g. exponential?)

Comment 5 Mike Fiedler 2020-06-11 14:55:19 UTC
I am hitting this even at low message rates (100 messages/second/node) across 10 pods/node

Comment 6 Jeff Cantrill 2020-06-18 19:05:31 UTC
Moving to UpcomingSprint as unlikely to address before EOS

Comment 7 Jeff Cantrill 2020-06-24 16:04:12 UTC
Running this test with:

* Eric M's SVT workload generator
* Default configuration
* Modifications to generator to allow 180 pods as NS should not be an issue: 'LABEL_ALL_NODES=true REPLICAS=180 NUM_LINES=45000 RATE=4500 ansible-playbook -v -i inventory workloads/logging.yml'
* Default ES configs

This is a shorter test but I don't see the expected number of logs come through.  I don't think fluent is wedged as we have run into the missed logged messages.  The pos file on one node shows they were read completely:

$ oc exec fluentd-25bb5 -- cat /var/log/es-containers.log.pos | grep logtest
/var/log/containers/centos-logtest-xsrhc_logtest-0_centos-logtest-4baf5f819a8c0c8d200ad028b55c39fbce5aa54c3a517ec9958505eddc356123.log	ffffffffffffffff	000000000fe037c9
/var/log/containers/centos-logtest-lkhmr_logtest-0_centos-logtest-bd40c78bb9913c90d703175a221d6bb6b35718652a5ed518267feb7c2898d407.log	ffffffffffffffff	00000000100645eb
/var/log/containers/centos-logtest-s77cg_logtest-0_centos-logtest-cf1172cc83dc0e9b288c755cfefd05810fbb4e418ae4c7c470bb08857759d1f9.log	ffffffffffffffff	0000000010201ac7

Agree ES is not loaded.

Rerunning and reverting: https://github.com/openshift/cluster-logging-operator/commit/8ceb6215e369ebbb754ab2da263c8c67d7a624b8

Comment 8 Mike Fiedler 2020-06-26 19:28:49 UTC
Found a possible way to reproduce the "wedged" scenario.  It appears the number of worker nodes has something to do with it which would imply ES does as well.
Case A:  All messages indexed
Case B:  The symptoms of this BZ, fluentd stops sending, gets backed up on buffer files and no further messages indexed.

Both cases, ES is running on 3 x m5.8xlarge with requests for 28 vCPU and 61Gi

Case A: 3 m5.xlarge worker nodes running 10 application pods, each logging at 50 messages second.  500 messages/second/node and 1500 messages/second total for cluster
Case B: 10 m5.xlarge worker nodes running 10 application pods each logging at 50 messages second.  500 messages/second/node and 5000 messages/second total for cluster

In case A all messages indexed.  In case B, logging stops after ~475K-750K messages indexed (number varies, but seems to be around there>

For case B (bad case),  ES is not showing high CPU, memory or IO.   There are no rejects and no obvious messages in the ES log)

Another hint that ES might be involved is that Prometheus endpoint data for ES stops exactly when the indexing stops.   I will attach the OS CPU/Memory graphs for one of the ES nodes.

Here are the ES queues when indexing stops:


host        name                rejected completed queue size active largest
10.129.8.18 analyze                    0         0     0    0      0       0
10.129.8.18 fetch_shard_started        0         0     0    0      0       0
10.129.8.18 fetch_shard_store          0         0     0    0      0       0
10.129.8.18 flush                      0       106     0    2      0       3
10.129.8.18 force_merge                0         0     0    0      0       0
10.129.8.18 generic                    0      1102     0    4      0       4
10.129.8.18 get                        0       874     0   28      0      28
10.129.8.18 index                      0         0     0    0      0       0
10.129.8.18 listener                   0         0     0    0      0       0
10.129.8.18 management                 0     57115     0    5      1       5
10.129.8.18 refresh                    0      5977     0    3      0       3
10.129.8.18 search                     0         0     0    0      0       0
10.129.8.18 search_throttled           0         0     0    0      0       0
10.129.8.18 snapshot                   0         0     0    0      0       0
10.129.8.18 warmer                     0     17831     0    5      0       5
10.129.8.18 write                      0     63231     0   28      0      28
10.131.8.17 analyze                    0         0     0    0      0       0
10.131.8.17 fetch_shard_started        0         0     0    0      0       0
10.131.8.17 fetch_shard_store          0         0     0    0      0       0
10.131.8.17 flush                      0       106     0    2      0       3
10.131.8.17 force_merge                0         0     0    0      0       0
10.131.8.17 generic                    0      4174     0    4      0       4
10.131.8.17 get                        0         0     0    0      0       0
10.131.8.17 index                      0         0     0    0      0       0
10.131.8.17 listener                   0         0     0    0      0       0
10.131.8.17 management                 0     57060     0    4      1       4
10.131.8.17 refresh                    0      5968     0    3      0       3
10.131.8.17 search                     0         0     0    0      0       0
10.131.8.17 search_throttled           0         0     0    0      0       0
10.131.8.17 snapshot                   0         0     0    0      0       0
10.131.8.17 warmer                     0     17887     0    5      0       5
10.131.8.17 write                      0     63239     0   28      0      28
10.130.8.18 analyze                    0         0     0    0      0       0
10.130.8.18 fetch_shard_started        0         0     0    0      0       0
10.130.8.18 fetch_shard_store          0         0     0    0      0       0
10.130.8.18 flush                      0       108     0    2      0       3
10.130.8.18 force_merge                0         0     0    0      0       0
10.130.8.18 generic                    0      4092     0    4      0       4
10.130.8.18 get                        0       879     0   28      0      28
10.130.8.18 index                      0         0     0    0      0       0
10.130.8.18 listener                   0         0     0    0      0       0
10.130.8.18 management                 0     56463     0    5      1       5
10.130.8.18 refresh                    0      8863     0    3      0       3
10.130.8.18 search                     0         0     0    0      0       0
10.130.8.18 search_throttled           0         0     0    0      0       0
10.130.8.18 snapshot                   0         0     0    0      0       0
10.130.8.18 warmer                     0     17885     0    5      0       5

Comment 9 Jeff Cantrill 2020-06-26 21:21:27 UTC
(In reply to Mike Fiedler from comment #8)
> Found a possible way to reproduce the "wedged" scenario.  It appears the
> 
> Case A: 3 m5.xlarge worker nodes running 10 application pods, each logging
> at 50 messages second.  500 messages/second/node and 1500 messages/second
> total for cluster
> Case B: 10 m5.xlarge worker nodes running 10 application pods each logging
> at 50 messages second.  500 messages/second/node and 5000 messages/second
> total for cluster

Are these not the cases we have already identified in https://bugzilla.redhat.com/show_bug.cgi?id=1833486 where upon reverting https://github.com/openshift/cluster-logging-operator/commit/8ceb6215e369ebbb754ab2da263c8c67d7a624b8 we can support 2500 m/s which is consistent with 4.4 but anything higher we have message loss not actually messages sitting in buffers?  In my short tests, any rates higher then 2500 m/s using the default fluent cpu (100mi) results in message loss meaning fluent is only shipping the messages it knows about

Comment 10 Periklis Tsirakidis 2020-07-06 07:10:49 UTC
Put UpcomingSprint, as ongoing investigation is not conclusive yet.

Comment 11 Jeff Cantrill 2020-07-07 19:55:25 UTC
Closing per https://bugzilla.redhat.com/show_bug.cgi?id=1846174#c12