databend icon indicating copy to clipboard operation
databend copied to clipboard

bug: list @stage don't show new files

Open bohutang opened this issue 3 years ago • 5 comments

Summary

Databend with local fs.

How to re-produce:

mysql> create stage xx;
 -- copy logs.parquet file to _data/stage/xx
mysql> list @xx;
+--------------+-------+------+-------------------------------+---------+
| name         | size  | md5  | last_modified                 | creator |
+--------------+-------+------+-------------------------------+---------+
| logs.parquet | 26592 | NULL | 2022-08-03 09:23:28.000 +0000 | NULL    |
+--------------+-------+------+-------------------------------+---------+

-- copy new logs.csv to _data/stage/xx

mysql> list @xx;
+--------------+-------+------+-------------------------------+---------+
| name         | size  | md5  | last_modified                 | creator |
+--------------+-------+------+-------------------------------+---------+
| logs.parquet | 26592 | NULL | 2022-08-03 09:23:28.000 +0000 | NULL    |
+--------------+-------+------+-------------------------------+---------+

-- Not show the new file logs.csv here

bohutang avatar Aug 03 '22 10:08 bohutang

copy new logs.csv to _data/stage/xx is a copy executed outside databend?

Xuanwo avatar Aug 04 '22 05:08 Xuanwo

This issue drives me to think about why we need to store internal stages' file info inside metasrv.

Cc @BohuTANG @flaneur2020 @junnplus for more information.

Xuanwo avatar Aug 04 '22 06:08 Xuanwo

copy new logs.csv to _data/stage/xx is a copy executed outside databend?

Yes.

bohutang avatar Aug 04 '22 06:08 bohutang

This issue drives me to think about why we need to store internal stages' file info inside metasrv.

We can read the stage directly through management mode, otherwise, the user needs to start the warehouse to query the stage.

junnplus avatar Aug 04 '22 06:08 junnplus

I guess it's a design issue, only data written via databend will be stored in metasrv, but if metasrv does not exist data will be read from dal.

You can use CALL SYSTEM$SYNC_STAGE_FILE(<stage_name>) to sync to metasrv.

junnplus avatar Aug 04 '22 06:08 junnplus

Has been fixed.

Xuanwo avatar Oct 27 '22 16:10 Xuanwo