[ 
https://issues.apache.org/jira/browse/SOLR-11677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16267275#comment-16267275
 ] 

Hoss Man commented on SOLR-11677:
---------------------------------

Just to be clear: in-place updates were always designed (and documented) from 
the stand point of being a _potential_ performance optimization that may happen 
when possible on a subset of atomic-updates (that supports it).  If the schema 
doesn't support Atomic Updates, or a situation occurs where a "regular" Atomic 
Update may lose data (because of re-indexing), then users (today) should 
certainly not attempt an in-place update -- that was the entire point of not 
having special syntax! from a user perspective they should treat it just like 
any other atomic update -- but in the right circumstance, some atomic-updates 
will be done "in place"

bq. So there should really be a way to enforce in-place docvalues updates and 
fail otherwise!

I guess I don't see any downside to this? .. perhaps something along the lines 
of...

{code}
{
 "id":"mydoc",
 "price":{"set":99,
          "inplace":true},
 "popularity":{"inc":20}
}
{code}
...where the value of "inplace" can be {{true}}, {{false}}, or {{null}} ...
* if {{true}}: the update will fail unless it can be done in in place
* if {{false}}: the update will force a reindex regardless of wether or not it 
would be possible to be done in place
* if {{null}} *(default)*: the update will be done in place if possible, 
otherwise reindexing will be done

the most common case being that nothing is specified and {{null}} is used by 
default; the most likeley un-common case being a user specifies 
{{inplace:true}} (while {{inplace:false}} would probably only ever exist in 
tests, but might prove useful down the road)

> Add ability to "enforce" in-place updates
> -----------------------------------------
>
>                 Key: SOLR-11677
>                 URL: https://issues.apache.org/jira/browse/SOLR-11677
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: update
>    Affects Versions: 6.6
>            Reporter: Uwe Schindler
>
> There is currently a problem with in-place updates: Under certain conditions, 
> an in-place update does not work, so Solr internally reindexes the whole 
> document. This is not bad in most cases, unless you have some fields in your 
> documents that are not stored (e.g. large fulltext fields). In that case, the 
> try to do in-place update leads to data loss!
> I'd suggest to add a request parameter in the update to "enforce in-place 
> mode". If not all conditions are met (e.g. field configuration is 
> incompatible, version field does not have all required settings, or user uses 
> other operations than "add" or "increment"), the request should simply fail - 
> to prevent data loss!
> There is also a related issue that may lead to data loss because of the same 
> issue: SOLR-11286. In this case it is completely unexpected because 
> everything is correct from the schema settings, but it still does reindex.
> So there should really be a way to enforce in-place docvalues updates and 
> fail otherwise!
> Another thing to maybe think of: Only prevent "reindexing" updates if 
> documents have some fields that are unstored!



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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

Reply via email to