mjsax commented on code in PR #15495:
URL: https://github.com/apache/kafka/pull/15495#discussion_r1524038413


##########
docs/streams/developer-guide/memory-mgmt.html:
##########
@@ -151,6 +151,10 @@
     Serdes.Long())
   .withCachingEnabled();</code></pre>
       <p>Record caches are not supported for <a class="reference internal" 
href="processor-api.html#streams-developer-guide-state-store-versioned"><span 
class="std std-ref">versioned state stores</span></a>.</p>
+      <p><strong>Caution:</strong> When using <code class="docutils 
literal"><span class="pre">withCachingEnabled()</span></code>,
+        if you <code class="docutils literal"><span 
class="pre">delete()</span></code> a key from the Store while iterating(e.g., 
<code class="docutils literal"><span 
class="pre">KeyValueIterator</span></code>) through the keys,
+        the value of the key that hasn't been flushed from the cache may be 
returned as a stale value.
+        Therefore, when deleting, you must <code class="docutils 
literal"><span class="pre">flush()</span></code> the cache before the 
iterator.</p>

Review Comment:
   I would rephrase this sentenc.
   ```
   To avoid reading stale data, you can `flush()` the store before creating the 
iterator. Note, that flushing too often can lead to performance degration if 
RocksDB is used, so we advice to avoid flushing manually in general.



##########
docs/streams/developer-guide/memory-mgmt.html:
##########
@@ -151,6 +151,10 @@
     Serdes.Long())
   .withCachingEnabled();</code></pre>
       <p>Record caches are not supported for <a class="reference internal" 
href="processor-api.html#streams-developer-guide-state-store-versioned"><span 
class="std std-ref">versioned state stores</span></a>.</p>
+      <p><strong>Caution:</strong> When using <code class="docutils 
literal"><span class="pre">withCachingEnabled()</span></code>,
+        if you <code class="docutils literal"><span 
class="pre">delete()</span></code> a key from the Store while iterating(e.g., 
<code class="docutils literal"><span 
class="pre">KeyValueIterator</span></code>) through the keys,

Review Comment:
   Cannot remember from the ticket, but was this limited to deletes, or also 
updates?



##########
docs/streams/developer-guide/memory-mgmt.html:
##########
@@ -151,6 +151,10 @@
     Serdes.Long())
   .withCachingEnabled();</code></pre>
       <p>Record caches are not supported for <a class="reference internal" 
href="processor-api.html#streams-developer-guide-state-store-versioned"><span 
class="std std-ref">versioned state stores</span></a>.</p>
+      <p><strong>Caution:</strong> When using <code class="docutils 
literal"><span class="pre">withCachingEnabled()</span></code>,
+        if you <code class="docutils literal"><span 
class="pre">delete()</span></code> a key from the Store while iterating(e.g., 
<code class="docutils literal"><span 
class="pre">KeyValueIterator</span></code>) through the keys,

Review Comment:
   ```suggestion
           if you <code class="docutils literal"><span 
class="pre">delete()</span></code> a key from the store while iterating (e.g., 
<code class="docutils literal"><span 
class="pre">KeyValueIterator</span></code>) through the keys,
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to