You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Leif Hedstrom (JIRA)" <ji...@apache.org> on 2011/01/28 00:09:43 UTC
[jira] Created: (TS-657) Wrong logic around read_while_writer
configuration
Wrong logic around read_while_writer configuration
--------------------------------------------------
Key: TS-657
URL: https://issues.apache.org/jira/browse/TS-657
Project: Traffic Server
Issue Type: Bug
Components: Configuration
Reporter: Leif Hedstrom
Fix For: 2.1.7
I think the logic around how we read / use the read_while_writer configuration is wrong. The logic should be to only enable read_while_writer if all these configs are set exactly like this:
{code}
CONFIG proxy.config.cache.enable_read_while_writer INT 1
CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.0
CONFIG proxy.config.cache.max_doc_size INT 0
{code}
This logic is encapsulated in a function
{code}
static int
update_cache_config(const char *name, RecDataT data_type, RecData data, void *cookie)
{
(void) name;
(void) data_type;
(void) cookie;
int new_value = data.rec_int;
if (new_value) {
float http_bg_fill;
IOCORE_ReadConfigFloat(http_bg_fill, "proxy.config.http.background_fill_completed_threshold");
if (http_bg_fill > 0.0) {
Note("to enable reading while writing a document, %s should be 0.0: read while writing disabled",
"proxy.config.http.background_fill_completed_threshold");
return 0;
}
if (cache_config_max_doc_size > 0) {
Note("to enable reading while writing a document, %s should be 0: read while writing disabled",
"proxy.config.cache.max_doc_size");
return 0;
}
}
cache_config_read_while_writer = new_value;
return 0;
}
{code}
But, as far as I can tell, this doesn't take effect unless the configuration is reloaded, e.g.
{code}
IOCORE_EstablishStaticConfigInt32(cache_config_read_while_writer, "proxy.config.cache.enable_read_while_writer");
IOCORE_RegisterConfigUpdateFunc("proxy.config.cache.enable_read_while_writer", update_cache_config, NULL);
{code}
At least from what I can tell, enabling read_while_writer takes effect even if those other two preconditions aren't satisfied. At least when running ATS from command line (traffic_server).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (TS-657) Wrong logic around read_while_writer
configuration
Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TS-657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leif Hedstrom resolved TS-657.
------------------------------
Resolution: Fixed
> Wrong logic around read_while_writer configuration
> --------------------------------------------------
>
> Key: TS-657
> URL: https://issues.apache.org/jira/browse/TS-657
> Project: Traffic Server
> Issue Type: Bug
> Components: Configuration
> Reporter: Leif Hedstrom
> Assignee: Leif Hedstrom
> Fix For: 2.1.7
>
>
> I think the logic around how we read / use the read_while_writer configuration is wrong. The logic should be to only enable read_while_writer if all these configs are set exactly like this:
> {code}
> CONFIG proxy.config.cache.enable_read_while_writer INT 1
> CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.0
> CONFIG proxy.config.cache.max_doc_size INT 0
> {code}
> This logic is encapsulated in a function
> {code}
> static int
> update_cache_config(const char *name, RecDataT data_type, RecData data, void *cookie)
> {
> (void) name;
> (void) data_type;
> (void) cookie;
> int new_value = data.rec_int;
> if (new_value) {
> float http_bg_fill;
> IOCORE_ReadConfigFloat(http_bg_fill, "proxy.config.http.background_fill_completed_threshold");
> if (http_bg_fill > 0.0) {
> Note("to enable reading while writing a document, %s should be 0.0: read while writing disabled",
> "proxy.config.http.background_fill_completed_threshold");
> return 0;
> }
> if (cache_config_max_doc_size > 0) {
> Note("to enable reading while writing a document, %s should be 0: read while writing disabled",
> "proxy.config.cache.max_doc_size");
> return 0;
> }
> }
> cache_config_read_while_writer = new_value;
> return 0;
> }
> {code}
> But, as far as I can tell, this doesn't take effect unless the configuration is reloaded, e.g.
> {code}
> IOCORE_EstablishStaticConfigInt32(cache_config_read_while_writer, "proxy.config.cache.enable_read_while_writer");
> IOCORE_RegisterConfigUpdateFunc("proxy.config.cache.enable_read_while_writer", update_cache_config, NULL);
> {code}
> At least from what I can tell, enabling read_while_writer takes effect even if those other two preconditions aren't satisfied. At least when running ATS from command line (traffic_server).
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Updated: (TS-657) Wrong logic around read_while_writer
configuration
Posted by "Leif Hedstrom (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/TS-657?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Leif Hedstrom updated TS-657:
-----------------------------
Assignee: Leif Hedstrom
> Wrong logic around read_while_writer configuration
> --------------------------------------------------
>
> Key: TS-657
> URL: https://issues.apache.org/jira/browse/TS-657
> Project: Traffic Server
> Issue Type: Bug
> Components: Configuration
> Reporter: Leif Hedstrom
> Assignee: Leif Hedstrom
> Fix For: 2.1.7
>
>
> I think the logic around how we read / use the read_while_writer configuration is wrong. The logic should be to only enable read_while_writer if all these configs are set exactly like this:
> {code}
> CONFIG proxy.config.cache.enable_read_while_writer INT 1
> CONFIG proxy.config.http.background_fill_completed_threshold FLOAT 0.0
> CONFIG proxy.config.cache.max_doc_size INT 0
> {code}
> This logic is encapsulated in a function
> {code}
> static int
> update_cache_config(const char *name, RecDataT data_type, RecData data, void *cookie)
> {
> (void) name;
> (void) data_type;
> (void) cookie;
> int new_value = data.rec_int;
> if (new_value) {
> float http_bg_fill;
> IOCORE_ReadConfigFloat(http_bg_fill, "proxy.config.http.background_fill_completed_threshold");
> if (http_bg_fill > 0.0) {
> Note("to enable reading while writing a document, %s should be 0.0: read while writing disabled",
> "proxy.config.http.background_fill_completed_threshold");
> return 0;
> }
> if (cache_config_max_doc_size > 0) {
> Note("to enable reading while writing a document, %s should be 0: read while writing disabled",
> "proxy.config.cache.max_doc_size");
> return 0;
> }
> }
> cache_config_read_while_writer = new_value;
> return 0;
> }
> {code}
> But, as far as I can tell, this doesn't take effect unless the configuration is reloaded, e.g.
> {code}
> IOCORE_EstablishStaticConfigInt32(cache_config_read_while_writer, "proxy.config.cache.enable_read_while_writer");
> IOCORE_RegisterConfigUpdateFunc("proxy.config.cache.enable_read_while_writer", update_cache_config, NULL);
> {code}
> At least from what I can tell, enabling read_while_writer takes effect even if those other two preconditions aren't satisfied. At least when running ATS from command line (traffic_server).
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira