github-actions[bot] commented on code in PR #69054:
URL: https://github.com/apache/doris/pull/69054#discussion_r4290516830


##########
be/src/runtime/index_policy/index_policy_mgr.cpp:
##########
@@ -204,9 +204,18 @@ AnalyzerPtr IndexPolicyMgr::get_policy_by_name(const 
std::string& name) {
     throw Exception(ErrorCode::INVALID_ARGUMENT, "Policy not found with type: 
" + name);
 }
 
-AnalyzerPtr IndexPolicyMgr::get_analyzer_by_name(const std::string& name) {
+AnalyzerPtr IndexPolicyMgr::get_analyzer_by_name(
+        const std::string& name, const InvertedIndexAnalyzerConfig* 
builtin_config) {
     std::shared_lock lock(_mutex);
     const std::string normalized_name = normalize_name(name);
+    // Preserve exact policy bindings before resolving a case variant of a 
built-in analyzer.
+    if (builtin_config != nullptr && 
!_exact_name_to_id.contains(trim_name(name)) &&
+        
segment_v2::inverted_index::InvertedIndexAnalyzer::is_builtin_analyzer(normalized_name))
 {

Review Comment:
   [P1] Preserve missing-policy failures for stored indexes
   
   This fallback also runs in 
`InvertedIndexColumnWriter::init_fulltext_index()`. After a BE restart, 
`ExecEnv` creates an empty policy manager and FE repopulates it through 
asynchronous `REPORT_INDEX_POLICY`/`PUSH_INDEX_POLICY`; heartbeat makes the BE 
load-available before that finishes. With a replayed exact policy `STANDARD` 
using `tokenizer=keyword` and an existing `analyzer=STANDARD` index, a load in 
this window now writes StandardAnalyzer postings instead of failing for the 
missing policy. Once synchronization completes, query providers resolve 
`STANDARD` to keyword again and miss those committed rows; pushing the policy 
does not repair the postings. Keep the case fallback opt-in for ad hoc 
`tokenize()` resolution, or preserve the authoritative stored-policy 
binding/readiness before allowing index writes.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to