summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-23 23:34:08 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-23 23:34:08 +0100
commitd79fc21db5785545a401988749eae3851a3bf646 (patch)
treea4e71112ac99de58a260e2895d64f9edd9faa5f4
parentc18963a9dd4339f1fdfa850d16dc273522f1d4db (diff)
downloadlsd0004-d79fc21db5785545a401988749eae3851a3bf646.tar.gz
lsd0004-d79fc21db5785545a401988749eae3851a3bf646.zip
-document use of xquery for filtering for approximate queries, fixes #7142; other minor edits/clarifications
-rw-r--r--draft-schanzen-r5n.xml39
1 files changed, 23 insertions, 16 deletions
diff --git a/draft-schanzen-r5n.xml b/draft-schanzen-r5n.xml
index db465f7..eb62dce 100644
--- a/draft-schanzen-r5n.xml
+++ b/draft-schanzen-r5n.xml
@@ -325,12 +325,15 @@ Connectivity | |Underlay| |Underlay|
325 Any combination of options as defined in <xref target="route_options"/> 325 Any combination of options as defined in <xref target="route_options"/>
326 may be specified. 326 may be specified.
327 </dd> 327 </dd>
328 <dt>Extended-Query:</dt> 328 <dt>eXtended-Query:</dt>
329 <dd> 329 <dd>
330 is extended query medatadata which may be 330 is extended query (XQuery) medatadata which may be
331 required depending on the respective <tt>Block-Type</tt>. 331 required depending on the respective <tt>Block-Type</tt>.
332 A <tt>Block-Type</tt> must define if the <tt>XQuery</tt> can or must 332 A <tt>Block-Type</tt> must define if the <tt>XQuery</tt> can or must
333 be used and what the specific format of its contents should be. 333 be used and what the specific format of its contents should be.
334 Extended queries are in general used to implement domain-specific filters.
335 These might be particularly useful in combination with approximate queries.
336 Regardless, the DHT does not define any particular semantics for an XQuery.
334 See also <xref target="blockstorage"/>. 337 See also <xref target="blockstorage"/>.
335 </dd> 338 </dd>
336 <dt>Result-Filter:</dt> 339 <dt>Result-Filter:</dt>
@@ -1107,7 +1110,7 @@ Connectivity | |Underlay| |Underlay|
1107 </dd> 1110 </dd>
1108 <dt>XQ_SIZE</dt> 1111 <dt>XQ_SIZE</dt>
1109 <dd> 1112 <dd>
1110 is a 32-bit number indicating the length of the optional 1113 is a 16-bit number indicating the length of the optional
1111 extended query XQUERY. In network byte order. 1114 extended query XQUERY. In network byte order.
1112 </dd> 1115 </dd>
1113 <dt>PEER_BF</dt> 1116 <dt>PEER_BF</dt>
@@ -1150,9 +1153,10 @@ Connectivity | |Underlay| |Underlay|
1150 against the 1153 against the
1151 requested <tt>BTYPE</tt> as defined by its respective 1154 requested <tt>BTYPE</tt> as defined by its respective
1152 <tt>ValidateBlockQuery</tt> procedure. 1155 <tt>ValidateBlockQuery</tt> procedure.
1153 If the <tt>BTYPE</tt> is not supported, or if the block key 1156 If the <tt>BTYPE</tt> is not supported, the message <bcp14>MUST</bcp14>
1154 does not match or if the <tt>XQUERY</tt> is malformed, 1157 be forwarded without query validation.
1155 the message <bcp14>MUST</bcp14> be discarded. 1158 However, If the <tt>BTYPE</tt> is supported and the <tt>XQUERY</tt>
1159 is malformed, the message <bcp14>MUST</bcp14> be discarded.
1156 </li> 1160 </li>
1157 <li> 1161 <li>
1158 The peer address of the sender peer <tt>P</tt> <bcp14>SHOULD</bcp14> be in the 1162 The peer address of the sender peer <tt>P</tt> <bcp14>SHOULD</bcp14> be in the
@@ -1330,24 +1334,27 @@ Connectivity | |Underlay| |Underlay|
1330 </li> 1334 </li>
1331 <li> 1335 <li>
1332 If the <tt>QUERY_HASH</tt> of this <tt>ResultMessage</tt> is found in the 1336 If the <tt>QUERY_HASH</tt> of this <tt>ResultMessage</tt> is found in the
1333 list of pending local queries, the <tt>QUERY_HASH</tt> and <tt>XQUERY</tt> 1337 list of pending local queries and the BTYPE is supported, then
1334 are validated against the requested BTYPE using the respective 1338 the <tt>QUERY_HASH</tt> and <tt>XQUERY</tt>
1339 <bcp14>MUST</bcp14> be validated against the requested BTYPE using the respective
1335 block type implementation of <tt>ValidateBlockReply</tt>. 1340 block type implementation of <tt>ValidateBlockReply</tt>.
1336 If the approximate flag is set and the BTYPE allows the 1341 If the approximate flag was not set in the query and the BTYPE allows the
1337 implementation to compute the key from the block it must match 1342 implementation to compute the key from the block, the computed key <bcp14>MUST</bcp14> match
1338 the QUERY_HASH. If the XQUERY is malformed, the message <bcp14>MUST</bcp14> be discarded. 1343 the QUERY_HASH. If there is a mismatch, the message <bcp14>MUST</bcp14> be discarded.
1339 <!-- FIXME: This should be reviewed.
1340 <= approximate flag -->
1341 </li> 1344 </li>
1342 <li> 1345 <li>
1343 The implementation <bcp14>MAY</bcp14> cache RESULT messages. 1346 The implementation <bcp14>SHOULD</bcp14> cache RESULT messages
1347 if the DemultiplexEverywhere flag was set on the query.
1344 </li> 1348 </li>
1345 <li> 1349 <li>
1346 <t> 1350 <t>
1347 If requests by other peers for this QUERY_HASH or BTYPE are 1351 If requests by other peers for this QUERY_HASH or BTYPE are
1348 known, 1352 known,
1349 the result block is validated against each request using 1353 the result block is validated against each request using
1350 the respective <tt>ValidateBlockReply</tt> function. 1354 the respective <tt>ValidateBlockReply</tt> function. If
1355 the BTYPE is not supported, filtering by the result Bloom
1356 filter <bcp14>MUST</bcp14> still be performed.
1357 <!-- FIXME-CG: check that it can be! Check implementation! -->
1351 </t> 1358 </t>
1352 <t> 1359 <t>
1353 If the request options include <tt>FindApproximate</tt> and the result 1360 If the request options include <tt>FindApproximate</tt> and the result
@@ -1416,7 +1423,7 @@ Connectivity | |Underlay| |Underlay|
1416 <dt>RESULT_INVALID</dt> 1423 <dt>RESULT_INVALID</dt>
1417 <dd>Invalid result. Block does not match query. Value = 4.</dd> 1424 <dd>Invalid result. Block does not match query. Value = 4.</dd>
1418 <dt>RESULT_IRRELEVANT</dt> 1425 <dt>RESULT_IRRELEVANT</dt>
1419 <dd>Block does not match xquery. Valid result, but not relevant for the request.</dd> 1426 <dd>Block does not match XQuery. Valid result, but not relevant for the request.</dd>
1420 </dl> 1427 </dl>
1421 </section> 1428 </section>
1422 <section anchor="block_functions"> 1429 <section anchor="block_functions">