XianReallyHot-ZZH opened a new pull request, #13717:
URL: https://github.com/apache/ignite/pull/13717

   Ticket: IGNITE-29183 (reported by the submitter)
   
   ## What changes
   
   One-line fix of an operator precedence error in the throttle condition of 
`InlineRecommender.recommend()`:
   
   ```java
   // before: parses as invokeCnt + (1 % inlineSizeThrottleThreshold) != 0
   boolean throttle = invokeCnt + 1 % inlineSizeThrottleThreshold != 0;
   
   // after
   boolean throttle = (invokeCnt + 1) % inlineSizeThrottleThreshold != 0;
   ```
   
   Because `%` binds tighter than `+`, the pre-fix condition was `invokeCnt + 1 
!= 0` with the default `IGNITE_THROTTLE_INLINE_SIZE_CALCULATION` of 1000 — 
always true, so the recommender returned early on every invocation and neither 
the "Indexed columns of a row cannot be fully inlined ..." nor the "Inline size 
is too big ..." warning could ever be logged with default settings (the feature 
has been inert since its introduction in IGNITE-12061). With the property set 
to 1 the condition degenerated to `invokeCnt != 0`, letting only the very first 
invocation per index through. The fix restores the documented sampling 
semantics: the check runs on every Nth invocation.
   
   ## Testing
   
   New `InlineRecommenderThrottleSelfTest` (modules/indexing): with a threshold 
of 2, six keys of strictly increasing length are each inserted and updated; the 
12 puts produce 12 recommender invocations, of which every second one must 
perform a check and log a warning (`LogListener` asserts the exact count of 6, 
one per key). The test fails on the unfixed code (0 warnings).
   
   Note: this PR is independent of #13715 — the production changes touch 
different lines of `InlineRecommender.java` and the test is a separate class; 
both tests were verified green in a combined working tree.


-- 
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