Skip to content

Problem with using FLAGS.TABLE to access table #119

@wang502

Description

@wang502

In src/lib/table_ingest.go, inside functionfunc (cb *SaveBlockChunkCB) CB(digestname string, records RecordList), FLAGS.TABLE is used to access the target table.

But using FLAGS.TABLE incurs a problem when I try to use it as a library instead of command line. If we have several goroutines, and each goroutine calls ingestion on different table, we simply can not guarantee they can access the table they want. In my local test, when I try to ingest data into table A, it happened that some block file is created inside /db/, instead of /db/A/, and final number of records stored in table A is less than the number of records I ingested. After I change the implementation using following way, this issue is gone.

So instead of using FLAGS.TABLE, maybe we can store corresponding table name inside struct SaveBlockChunkCB, and inside CB(), we use t := GetTable(cb.table) to access the table.

Let me know if I'm missing anything. If this is a real problem and the solution sounds viable, I will put up a pull request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions