From: David Mandelberg <da...@mandelberg.org> RFC 6810, Section 6.4 indicates that we should send No Data Available instead of a Cache Reset in this case. Either way works fine in practice, but we should follow the spec.
addresses [#4] --- lib/db/clients/rtr.c | 9 +++++---- tests/subsystem/rtr/response.no_data.log.correct | 4 ++-- tests/subsystem/rtr/test.sh.in | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/db/clients/rtr.c b/lib/db/clients/rtr.c index c1583c1..1fb2a96 100644 --- a/lib/db/clients/rtr.c +++ b/lib/db/clients/rtr.c @@ -702,9 +702,10 @@ int db_rtr_serial_query_init( } // If rtr_update is not empty, then send cache reset. - // If rtr_update is empty, then send cache-reset. - // By spec, this could send not-ready, but rtr-client's session_id and - // serial_num will never become valid. + // If rtr_update is empty, then send no-data-available. + // The session_id and serial_num will never become valid in the + // second case, but RFC6810 section 6.4 says to send + // no-data-available. ret = hasRowsRtrUpdate(conn); if (ret == -1) { @@ -715,7 +716,7 @@ int db_rtr_serial_query_init( } else if (ret == 0) { // rtr_update is empty - state->bad_ser_num = 1; + state->not_ready = 1; } else if (ret > 0) { // rtr_update is not empty, diff --git a/tests/subsystem/rtr/response.no_data.log.correct b/tests/subsystem/rtr/response.no_data.log.correct index 25b3e3d..06790be 100644 --- a/tests/subsystem/rtr/response.no_data.log.correct +++ b/tests/subsystem/rtr/response.no_data.log.correct @@ -5,5 +5,5 @@ version 0 Error Report (No Data), length = 24, encapsulated PDU length = 8, erro --- expecting: Cache Reset version 0 Cache Reset, length = 8 --- serial_query 42 0 ---- expecting: Cache Reset -version 0 Cache Reset, length = 8 +--- expecting: No Data Available +version 0 Error Report (No Data), length = 28, encapsulated PDU length = 12, error text = [0] "" diff --git a/tests/subsystem/rtr/test.sh.in b/tests/subsystem/rtr/test.sh.in index 271b488..01c7286 100644 --- a/tests/subsystem/rtr/test.sh.in +++ b/tests/subsystem/rtr/test.sh.in @@ -271,7 +271,7 @@ start_rtrd start_test no_data client "reset_query" "No Data Available" client "serial_query $WRONG_SESSION 0" "Cache Reset" -client "serial_query $SESSION 0" "Cache Reset" +client "serial_query $SESSION 0" "No Data Available" stop_test no_data start_test reset_query_first -- 1.9.1 ------------------------------------------------------------------------------ Dive into the World of Parallel Programming. The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net/ _______________________________________________ rpstir-devel mailing list rpstir-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rpstir-devel