Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-35063

Assertion `v->distance_to_target >= threshold' fails upon adding certain values to vector key

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Fixed
    • N/A
    • 11.7.1
    • Vector search
    • None

    Description

      CREATE TABLE t (a INT, v BLOB NOT NULL, VECTOR(v));
      INSERT INTO t VALUES (1,x'78787878'),(2,x'78787878');
       
      # Cleanup
      DROP TABLE t;
      

      bb-11.6-MDEV-32887-vector b08382736a45bf2793d8b368dd902bd6a140aec6

      mariadbd: /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/vector_mhnsw.cc:1042: int search_layer(MHNSW_Share*, TABLE*, const FVector*, float, uint, size_t, Neighborhood*, bool): Assertion `v->distance_to_target >= threshold' failed.
       
      #9  0x00007f71db253e32 in __GI___assert_fail (assertion=0x564f2ea6b3e0 "v->distance_to_target >= threshold", file=0x564f2ea6ab80 "/data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/vector_mhnsw.cc", line=1042, function=0x564f2ea6b300 "int search_layer(MHNSW_Share*, TABLE*, const FVector*, float, uint, size_t, Neighborhood*, bool)") at ./assert/assert.c:101
      #10 0x0000564f2ce2fe20 in search_layer (ctx=0x61d00023f0b8, graph=0x6190000a37b8, target=0x7f71ce56c978, threshold=-1, result_size=12, layer=0, inout=0x7f71cfd05ce0, construction=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/vector_mhnsw.cc:1042
      #11 0x0000564f2ce3280e in mhnsw_insert (table=0x61900009dd98, keyinfo=0x61900009e530) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/vector_mhnsw.cc:1205
      #12 0x0000564f2beccca1 in TABLE::hlindexes_on_insert (this=0x61900009dd98) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_base.cc:9919
      #13 0x0000564f2ca22885 in handler::ha_write_row (this=0x61d000224cb8, buf=0x61900009e2c8 "\376\002") at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/handler.cc:8163
      #14 0x0000564f2bf9e63e in write_record (thd=0x62c0000c0218, table=0x61900009dd98, info=0x7f71cfd064e0, sink=0x0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_insert.cc:2322
      #15 0x0000564f2bf94d6e in mysql_insert (thd=0x62c0000c0218, table_list=0x6290000e6388, fields=..., values_list=..., update_fields=..., update_values=..., duplic=DUP_ERROR, ignore=false, result=0x0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_insert.cc:1179
      #16 0x0000564f2c065038 in mysql_execute_command (thd=0x62c0000c0218, is_called_from_prepared_stmt=false) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_parse.cc:4458
      #17 0x0000564f2c07cbfa in mysql_parse (thd=0x62c0000c0218, rawbuf=0x6290000e6238 "INSERT INTO t VALUES (1,x'78787878'),(2,x'78787878')", length=52, parser_state=0x7f71cfd079f0) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_parse.cc:7873
      #18 0x0000564f2c053c1c in dispatch_command (command=COM_QUERY, thd=0x62c0000c0218, packet=0x629000253219 "INSERT INTO t VALUES (1,x'78787878'),(2,x'78787878')", packet_length=52, blocking=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_parse.cc:1892
      #19 0x0000564f2c050930 in do_command (thd=0x62c0000c0218, blocking=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_parse.cc:1405
      #20 0x0000564f2c540189 in do_handle_one_connection (connect=0x6080000034b8, put_in_cache=true) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_connect.cc:1448
      #21 0x0000564f2c53fb4a in handle_one_connection (arg=0x608000003438) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/sql/sql_connect.cc:1350
      #22 0x0000564f2d1e331c in pfs_spawn_thread (arg=0x617000005b98) at /data/bld/preview-11.7-bb-11.6-MDEV-32887-vector-asan/storage/perfschema/pfs.cc:2198
      #23 0x00007f71db2a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
      #24 0x00007f71db32861c in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
      

      vec_totext translates the value into [20158328397634018000000000000000000.000000].

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.