You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "janl (via GitHub)" <gi...@apache.org> on 2025/04/18 10:29:57 UTC

[PR] Support OTP 28 [couchdb]

janl opened a new pull request, #5507:
URL: https://github.com/apache/couchdb/pull/5507

   based on -rc3
   
   c.f. https://github.com/erlang/otp/issues/9739


-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on code in PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#discussion_r2053326145


##########
src/mango/src/mango_cursor.erl:
##########
@@ -1113,6 +1113,12 @@ extract_selector_hints_test_() ->
         ]
     }.
 
+expect_set_from_list_ordered(L) ->
+    case erlang:system_info(otp_release) of
+        N when N >= "28" -> lists:sort(L);
+        _ -> L
+    end.
+

Review Comment:
   I gave it a try here https://github.com/apache/couchdb/pull/5510. It's a general improvement regardless of OTP version that just make us use all new sets and sorts the results to they are deterministic, otherwise tests might fail randomly again in the future



-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "janl (via GitHub)" <gi...@apache.org>.
janl commented on PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#issuecomment-2815455007

   And then still in Mango, we get this a couple of times, seems we expect a reversal of some sort that is no longer happening. I haven’t had time to dig into this, but there were erl_syntax changes around reversal of lists in rc3, will update here when I know more:
   
   ```
    mango_cursor:1110: -extract_selector_hints_test_/0-fun-4- (t_extract_selector_hints_view)...*failed*
   in function mango_cursor:t_extract_selector_hints_view/1 (src/mango_cursor.erl, line 1129)
   in call from eunit_test:run_testfun/1 (eunit_test.erl, line 83)
   in call from eunit_proc:run_test/1 (eunit_proc.erl, line 554)
   in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 379)
   in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 537)
   in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 479)
   in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 369)
   in call from eunit_proc:run_group/2 (eunit_proc.erl, line 593)
   **error:{assertEqual,[{module,mango_cursor},
                 {line,1129},
                 {expression,"extract_selector_hints ( selector )"},
                 {expected,[{[{type,json},
                              {indexable_fields,["field2"]},
                              {unindexable_fields,["field3","field1"]}]}]},
                 {value,[{[{type,json},
                           {indexable_fields,["field2"]},
                           {unindexable_fields,["field1","field3"]}]}]}]}
     output:<<"">>
   ```


-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "janl (via GitHub)" <gi...@apache.org>.
janl merged PR #5507:
URL: https://github.com/apache/couchdb/pull/5507


-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "janl (via GitHub)" <gi...@apache.org>.
janl commented on PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#issuecomment-2826677244

   cleaned up the WIP work that @nickva has been properly fixing in the referenced commit. This should be ready to go now.


-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "janl (via GitHub)" <gi...@apache.org>.
janl commented on PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#issuecomment-2815266331

   My local testing box (macOS 16.4.1/latest, arm64) with OTP-28-rc3 makes this test fail:
   
   ```
   module 'chttpd_socket_buffer_size_test'
     chttpd socket_buffer_size_test
       chttpd_socket_buffer_size_test:67: -default_buffer/2-fun-1-...[0.023 s] ok
       chttpd_socket_buffer_size_test:51: -small_recbuf/2-fun-1-...*failed*
   in function chttpd_socket_buffer_size_test:'-small_recbuf/2-fun-1-'/1 (test/eunit/chttpd_socket_buffer_size_test.erl, line 54)
   in call from eunit_test:run_testfun/1 (eunit_test.erl, line 83)
   in call from eunit_proc:run_test/1 (eunit_proc.erl, line 554)
   in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 379)
   in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 537)
   in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 479)
   in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 369)
   in call from eunit_proc:run_group/2 (eunit_proc.erl, line 593)
   **error:{assert,[{module,chttpd_socket_buffer_size_test},
            {line,54},
            {expression,"Response =:= 400 orelse Response =:= request_failed"},
            {expected,true},
            {value,false}]}
     output:<<"">>
   ```
   
   In the logs, the expected-to-fail request shows a 201:
   
   ```
   [notice] 2025-04-18T10:09:29.375779Z nonode@nohost <0.639.0> 8925f5c766 127.0.0.1:60869 127.0.0.1 chttpd_db_socket_buffer_size_test_admin PUT /eunit-test-db-145c735070a4bad74540e819cebb134e/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 201 ok 17
   ```
   
   The [relevant test bits](https://github.com/apache/couchdb/blob/f997e718a52d501072fcbe7f0c700520bf428ec8/src/chttpd/test/eunit/chttpd_socket_buffer_size_test.erl#L43-L55) are just:
   
   ```
                   {"[{recbuf, 1024}]", fun small_recbuf/2},
   ```
   
   ```
   small_recbuf(_, {_, Db}) ->
       {timeout, 30,
           ?_test(begin
               Id = data(2048),
               Response = put_req(url(Db) ++ "/" ++ Id, "{}"),
               ?assert(Response =:= 400 orelse Response =:= request_failed)
           end)}.
   ```
   
   I couldn’t find anything obvious in our or the OTP commits that could cause this.
   
   The test passes with OTP-25 and -27 and -28-rc2.


-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "janl (via GitHub)" <gi...@apache.org>.
janl commented on PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#issuecomment-2815450804

   Next, Mango:
   
   The [PCRE2 upgrade notes](https://www.erlang.org/docs/28/apps/stdlib/re_incompat) state:
   
   > Compiled Patterns Should Not be Shared: Sharing the result of re:compile/2 across node boundaries or persisting it has never been officially supported, although it might have accidentally worked between certain previous versions. The internal format produced by re:compile/2 has changed, and will not work on older OTP versions or across nodes. Relying on this undocumented behavior must be changed to compile the regular expression on the node instance where it is intended to be used.
   
   This seems to include `mochiglobal:put()`:
   
   ```
     mango_idx_text: indexable_fields_test...*failed*
   in function erl_syntax:abstract/1 (erl_syntax.erl, line 7294)
   in call from erl_syntax:abstract_list/1 (erl_syntax.erl, line 7297)
   in call from erl_syntax:abstract_list/1 (erl_syntax.erl, line 7297)
   in call from erl_syntax:abstract/1 (erl_syntax.erl, line 7280)
   in call from mochiglobal:term_to_abstract/3 (src/mochiglobal.erl, line 95)
   in call from mochiglobal:forms/2 (src/mochiglobal.erl, line 77)
   in call from mochiglobal:compile/2 (src/mochiglobal.erl, line 71)
   in call from mochiglobal:put/3 (src/mochiglobal.erl, line 51)
   **error:{badarg,#Ref<0.2315338412.3477471233.154666>}
     output:<<"">>
   ```
   
   This change to mango_util fixes the issues, but now we are not caching the compiled re:
   
   ```diff
    cached_re(Name, RE) ->
   -    case mochiglobal:get(Name) of
   -        undefined ->
   -            {ok, MP} = re:compile(RE),
   -            ok = mochiglobal:put(Name, MP),
   -            MP;
   -        MP ->
   -            MP
   -    end.
   +    {ok, MP} = re:compile(RE),
   +    MP. 
   ```
   
   


-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on code in PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#discussion_r2051872904


##########
src/mango/src/mango_cursor.erl:
##########
@@ -1113,6 +1113,12 @@ extract_selector_hints_test_() ->
         ]
     }.
 
+expect_set_from_list_ordered(L) ->
+    case erlang:system_info(otp_release) of
+        N when N >= "28" -> lists:sort(L);
+        _ -> L
+    end.
+

Review Comment:
   Instead of hard-coding OTP 28 checks in the test, the test should be improved to check that either the sets match or the the sorted lists of expected vs actual `unindexable_fields` match.



-- 
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: notifications-unsubscribe@couchdb.apache.org

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


Re: [PR] Support OTP 28 [couchdb]

Posted by "nickva (via GitHub)" <gi...@apache.org>.
nickva commented on PR #5507:
URL: https://github.com/apache/couchdb/pull/5507#issuecomment-2820029313

   This [pr](https://github.com/apache/couchdb/pull/5509) should fix the mochiglobal issue. Thanks to @jaydoane for the review


-- 
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: notifications-unsubscribe@couchdb.apache.org

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