matrixone icon indicating copy to clipboard operation
matrixone copied to clipboard

[Bug]: vector index:create index which lists=1000 reported file 018e79d2-44ae-714c-9acf-15798c49c41b_00000 is not found

Open heni02 opened this issue 1 year ago • 24 comments

Is there an existing issue for the same bug?

  • [X] I have checked the existing issues.

Branch Name

main

Commit ID

b85d7579eec4ca041b63ecf8cf9ceef325f59071

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

gist 960dim 100M create index lists=1000 reported error file 018e79d2-44ae-714c-9acf-15798c49c41b_00000 is not found 企业微信截图_a8cdd443-e11f-467d-a9d2-d3b0a667505d 企业微信截图_00d192dd-0cd9-47fd-b20b-3211ffecaf3a

Expected Behavior

No response

Steps to Reproduce

1.create table t3(a int, b vecf32(960));
1.use benchmark tool load gist 960dim 100M data
2.create index idx3 using ivfflat on t3(b) lists=1000 op_type "vector_l2_ops";

Additional information

No response

heni02 avatar Mar 26 '24 11:03 heni02

Internally "CREATE INDEX" is running only 3 SQL queries.

I think it is similar to this issue: https://github.com/matrixorigin/matrixone/issues/14529

@triump2020 could you kindly have a look at this?

arjunsk avatar Mar 26 '24 18:03 arjunsk

  1. Create the database and table
create database a;
use a;
create table t3(a int, b vecf32(960));
  1. Download GIST dataset and unzip http://corpus-texmex.irisa.fr/ image

  2. Run the python code to insert GIST960 data. Replace /Users/arjunsunilkumar/Downloads/benchmark/1million/gist/gist_base.fvecs

import binascii
import time

import numpy as np
from sqlalchemy import create_engine, text
from sqlalchemy.orm import sessionmaker


def to_db_binary(value):
    if value is None:
        return value

    value = np.asarray(value, dtype='<f4')
    if value.ndim != 1:
        raise ValueError('expected ndim to be 1')

    return binascii.b2a_hex(value.tobytes()).decode('utf-8')


def fvecs_read(filename, c_contiguous=True):
    fv = np.fromfile(filename, dtype=np.float32)
    if fv.size == 0:
        return np.zeros((0, 0))
    dim = fv.view(np.int32)[0]
    assert dim > 0
    fv = fv.reshape(-1, 1 + dim)
    fv = fv[:, 1:]
    if c_contiguous:
        fv = np.ascontiguousarray(fv)
    return fv


def run():
    # use pymysql
    engine = create_engine("mysql+pymysql://root:[email protected]:6001/a")
    Session = sessionmaker(bind=engine)
    session = Session()

    sql_insert = text("INSERT INTO t5 (a, b) VALUES (:id, decode(:data,'hex'));")

    start = time.time()
    vecList = fvecs_read("/Users/arjunsunilkumar/Downloads/benchmark/1million/gist/gist_base.fvecs")
    binVecList = []
    for i in range(0, len(vecList)):
        binVecList.append(to_db_binary(vecList[i]))
    print(f"binary duration={time.time() - start}")

    for i in range(0, len(binVecList)):
        session.execute(sql_insert, {"id": i, "data": binVecList[i]})
        if i % 1000 == 0:
            print(f"inserted {i}")

    # commit last
    session.commit()


def main():
    start = time.time()
    run()
    duration = time.time() - start
    print(f"duration={duration}")


if __name__ == "__main__":
    main()
  1. Create index using this query
create index idx3 using ivfflat on t3(b) lists=1000 op_type "vector_l2_ops";

arjunsk avatar Mar 27 '24 06:03 arjunsk

blocked

triump2020 avatar Apr 01 '24 11:04 triump2020

Not working on this

triump2020 avatar Apr 09 '24 11:04 triump2020

Not working on this

triump2020 avatar Apr 13 '24 10:04 triump2020

reassigned to @volgariver6

XuPeng-SH avatar Apr 17 '24 05:04 XuPeng-SH

本地试了一次,没有复现,需要多试一下

volgariver6 avatar Apr 22 '24 10:04 volgariver6

暂无进展

volgariver6 avatar Apr 25 '24 12:04 volgariver6

暂无进展

gouhongshen avatar Apr 30 '24 10:04 gouhongshen

reporduced on local, the not found is caused by GC delete. and this object was merged before that deletes.

grep "018f4cd6-8533-76db-9005-bb00a47c7cb7_00000" matrixone/mo-service.log 

{"level":"INFO","time":"2024/05/06 15:59:36.115022 +0800","caller":"merge/executor.go:231","msg":"[Mergeblocks] Scheduled 272505-t3 [t1224|on2,bn2|1.99MB,11.95MB], merged(538):  269(3cfb75799ece) 269(bb00a47c7cb7)"}
{"level":"INFO","time":"2024/05/06 15:59:36.115169 +0800","caller":"mergesort/task.go:107","msg":"[Start] Mergeblocks","table":"t3","txn-start-ts":"1714982376115110051-0","from-objs":"3cfb75799ece,bb00a47c7cb7,"}

{"level":"INFO","time":"2024/05/06 17:02:41.595889 +0800","caller":"gc/delete.go:70","msg":"[DB GC] disableGC: false, files to delete: [018f4cd6-90ab-7017-9561-9a6d307b84d5_00000 018f4cd6-8533-76db-9005-bb00a47c7cb7_00000 018f4ce8-ff67-75dd-a631-89144e5f221f_00000 018f4ce8-f0b5-7482-a28d-eaff168ce745_00000 ...

{"level":"ERROR","time":"2024/05/06 17:04:02.164434 +0800","caller":"fileservice/local_fs.go:435","msg":"error: file 018f4cd6-8533-76db-9005-bb00a47c7cb7_00000 is not found"}

{"level":"ERROR","time":"2024/05/06 17:28:23.583578 +0800","name":"log-service.frontend","caller":"frontend/mysql_cmd_executor.go:3202","msg":"file 018f4cd6-8533-76db-9005-bb00a47c7cb7_00000 is not found","uuid":"7c4dccb4-4d3c-41f8-b482-5251dc7a41bf","session_info":"connectionId 1001|127.0.0.1:16722|{account sys:dump:moadmin -- 0:1:0}|goRoutineId 580147|018f4ce9-443a-7ec4-8fcb-bb310673af9e","session_id":"018f4ce9-443a-7ec4-8fcb-bb310673af9e","statement_id":"018f4ce9-bf37-7471-bce3-02a5dd3d7fb9","txn_id":"018f4ce9bf37786a969e56e99819076a/Active/S:1714982338357691859-1"}

the log mo-service (1).log.zip

gouhongshen avatar May 06 '24 09:05 gouhongshen

the ts of that aborted txn is smaller than the merge ts, so this not found err is not expected. 1714982338357691859-1 1714982376115110051-0 merge ts

this created index txn lasted too long, exceeded 1h.

gouhongshen avatar May 06 '24 10:05 gouhongshen

这个事务运行时间超过1小时了,为什么会出现这种事务,我们soft delete的数据,超过1个小时就会被gc。所以这个是预期的

LeftHandCold avatar May 10 '24 10:05 LeftHandCold

无进展

LeftHandCold avatar May 20 '24 11:05 LeftHandCold

无进展

LeftHandCold avatar May 23 '24 14:05 LeftHandCold

无进展

LeftHandCold avatar May 28 '24 10:05 LeftHandCold

无进展

LeftHandCold avatar May 31 '24 12:05 LeftHandCold

无进展

LeftHandCold avatar Jun 05 '24 11:06 LeftHandCold

无进展

LeftHandCold avatar Jun 10 '24 10:06 LeftHandCold

无进展

LeftHandCold avatar Jun 13 '24 10:06 LeftHandCold

无进展

LeftHandCold avatar Jun 19 '24 10:06 LeftHandCold

暂无进展

LeftHandCold avatar Jun 24 '24 12:06 LeftHandCold

暂无进展

LeftHandCold avatar Jun 27 '24 10:06 LeftHandCold

无进展

LeftHandCold avatar Jul 02 '24 11:07 LeftHandCold

这个需要GC消费cn最小的txn时间戳才可以实现

LeftHandCold avatar Jul 18 '24 02:07 LeftHandCold

这个需要GC消费cn最小的txn时间戳才可以实现

LeftHandCold avatar Jul 23 '24 10:07 LeftHandCold

这个需要GC消费cn最小的txn时间戳才可以实现

LeftHandCold avatar Jul 26 '24 10:07 LeftHandCold

这个需要GC消费cn最小的txn时间戳才可以实现

LeftHandCold avatar Jul 29 '24 10:07 LeftHandCold

这个需要GC消费cn最小的txn时间戳才可以实现

LeftHandCold avatar Aug 01 '24 10:08 LeftHandCold

这个需要GC消费cn最小的txn时间戳才可以实现

LeftHandCold avatar Aug 06 '24 11:08 LeftHandCold

同上

LeftHandCold avatar Aug 19 '24 10:08 LeftHandCold