[
https://issues.apache.org/jira/browse/KNOX-2773?focusedWorklogId=788518&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-788518
]
ASF GitHub Bot logged work on KNOX-2773:
----------------------------------------
Author: ASF GitHub Bot
Created on: 07/Jul/22 08:00
Start Date: 07/Jul/22 08:00
Worklog Time Spent: 10m
Work Description: MrtnBalazs opened a new pull request, #604:
URL: https://github.com/apache/knox/pull/604
## What changes were proposed in this pull request?
The replayBufferSize log level was changed from debug to info, to prevent
confusion on what value was used, since it can be configured in two places
(topology file and service.xml). Now the client can see what value was
configured as replayBufferSize in the log after the first request after
deploying a topology.
## How was this patch tested?
I tested it manually, using the following curl command
`curl -k -u tom:tom-password https://localhost:8443/gateway/sandbox/hive`
1. No configuration in either file
The log output was:
```
2022-07-07 09:27:30,761 ff7f8623-703b-4118-9d83-7a73d5f37231 INFO
knox.gateway (KnoxLdapRealm.java:getUserDn(688)) - Computed userDn:
uid=tom,ou=people,dc=hadoop,dc=apache,dc=org using dnTemplate for principal: tom
2022-07-07 09:27:34,515 ff7f8623-703b-4118-9d83-7a73d5f37231 INFO
knox.gateway (DefaultDispatch.java:setReplayBufferSizeInBytes(121)) -
replayBufferSize is set to -1 for HIVE
```
2. Configured in service.xml
Configuration:
```
<param>
<name>replayBufferSize</name>
<value>11</value>
</param>
```
Log output:
```
022-07-07 09:29:46,028 d15fb564-9185-420c-91da-3c31734e1a9c INFO
knox.gateway (KnoxLdapRealm.java:getUserDn(688)) - Computed userDn:
uid=tom,ou=people,dc=hadoop,dc=apache,dc=org using dnTemplate for principal: tom
2022-07-07 09:29:54,590 d15fb564-9185-420c-91da-3c31734e1a9c INFO
knox.gateway (DefaultDispatch.java:setReplayBufferSizeInBytes(121)) -
replayBufferSize is set to 11,264 for HIVE
```
3. Configured in service.xml and in the topology file
Service.xml configuration:
```
<param>
<name>replayBufferSize</name>
<value>11</value>
</param>
```
Topology configuration:
```
<param>
<name>replayBufferSize</name>
<value>5</value>
</param>
```
Log output:
```
022-07-07 09:31:30,155 df38456e-3b9c-4f29-baca-768a323f4bbe INFO
knox.gateway (KnoxLdapRealm.java:getUserDn(688)) - Computed userDn:
uid=tom,ou=people,dc=hadoop,dc=apache,dc=org using dnTemplate for principal: tom
2022-07-07 09:31:33,457 df38456e-3b9c-4f29-baca-768a323f4bbe INFO
knox.gateway (DefaultDispatch.java:setReplayBufferSizeInBytes(121)) -
replayBufferSize is set to 5,120 for HIVE
```
We can see that the topology file overrides the service.xml if they are
configured differently.
Issue Time Tracking
-------------------
Worklog Id: (was: 788518)
Remaining Estimate: 0h
Time Spent: 10m
> Log replay buffer size with info level
> --------------------------------------
>
> Key: KNOX-2773
> URL: https://issues.apache.org/jira/browse/KNOX-2773
> Project: Apache Knox
> Issue Type: Improvement
> Reporter: Balazs Marton
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Replay buffer size can be defined in two places, in the topology file and in
> the service.xml.
> The topology file takes priority over the service.xml. To prevent confusion
> it would be nice to see it's value in the log.
> {code:java}
> <service>
> <role>HIVE</role>
> <url>http://localhost:10001/cliservice</url>
> <param>
> <name>replayBufferSize</name>
> <value>8</value>
> </param>
> </service>
> {code}
> {code:java}
> <dispatch classname="org.apache.knox.gateway.dispatch.ConfigurableDispatch"
>
> ha-classname="org.apache.knox.gateway.ha.dispatch.ConfigurableHADispatch">
> <param>
> <name>responseExcludeHeaders</name>
> <value>WWW-AUTHENTICATE</value>
> </param>
> <param>
> <name>replayBufferSize</name>
> <value>65</value>
> </param>
> </dispatch>
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)