You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2021/10/28 09:27:55 UTC

[GitHub] [solr] janhoy commented on a change in pull request #371: SOLR-15718 Remove backcompat feature solr.useUnsafeOverseerResponse

janhoy commented on a change in pull request #371:
URL: https://github.com/apache/solr/pull/371#discussion_r738208768



##########
File path: solr/core/src/java/org/apache/solr/cloud/OverseerSolrResponseSerializer.java
##########
@@ -34,40 +33,22 @@
    * <li>"Unknown" elements for the Javabin format will be serialized as Strings. See {@link org.apache.solr.common.util.JavaBinCodec#writeVal}</li>
    * </ul>
    */
-  @SuppressWarnings("deprecation")
   public static byte[] serialize(OverseerSolrResponse responseObject) {
     Objects.requireNonNull(responseObject);
-    if (useUnsafeSerialization()) {
-      return SolrResponse.serializable(responseObject);
-    }
     try {
       return Utils.toJavabin(responseObject.getResponse()).readAllBytes();
     } catch (IOException|RuntimeException e) {
       throw new SolrException(ErrorCode.SERVER_ERROR, "Exception serializing response to Javabin", e);
     }
   }
   
-  static boolean useUnsafeSerialization() {
-    String useUnsafeOverseerResponse = System.getProperty("solr.useUnsafeOverseerResponse");
-    return useUnsafeOverseerResponse != null && ("true".equals(useUnsafeOverseerResponse));
-  }
-  
-  static boolean useUnsafeDeserialization() {
-    String useUnsafeOverseerResponse = System.getProperty("solr.useUnsafeOverseerResponse");
-    return useUnsafeOverseerResponse != null && ("true".equals(useUnsafeOverseerResponse) || "deserialization".equals(useUnsafeOverseerResponse));
-  }
-
-  @SuppressWarnings("deprecation")
   public static OverseerSolrResponse deserialize(byte[] responseBytes) {
     Objects.requireNonNull(responseBytes);
     try {
       @SuppressWarnings("unchecked")
       NamedList<Object> response = (NamedList<Object>) Utils.fromJavabin(responseBytes);
       return new OverseerSolrResponse(response);
     } catch (IOException|RuntimeException e) {
-      if (useUnsafeDeserialization()) {
-        return (OverseerSolrResponse) SolrResponse.deserialize(responseBytes);

Review comment:
       You mean for people attempting an upgrade directly from <8.5 to 9.0? I wonder if the RefGuide chapter "[Solr 9 Upgrade Planning](https://github.com/apache/solr/blob/main/solr/solr-ref-guide/src/major-changes-in-solr-9.adoc#solr-9-upgrade-planning)" needs to specify the minimum version from which an upgrade is supported. Currently it talks about 8.1, but it should probably tell people to first upgrade to 8.11, then to 9.0?
   
   But if people don't listen to that advice, could we perhaps check for this sysProp immediately on startup, e.g. in `SolrDispatchFilter#init()`, and refuse to start at all?




-- 
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: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org