influxdata / influxdb

Scalable datastore for metrics, events, and real-time analytics
https://influxdata.com
Apache License 2.0
29.01k stars 3.56k forks source link

BUG Old tags show up after dropping measurement #20192

Open coguin opened 3 years ago

coguin commented 3 years ago

Steps to reproduce: List the minimal actions needed to reproduce the behavior.

  1. use influx_stress insert data to database test, measurement m1, write until tsi files created.
  2. show tag keys from m1 result=[t1,t2,t3,t4,t5,t6]
  3. drop measurement m1 return without error
  4. insert m1,t1=1 f1=1
  5. show tag keys from m1 result=[t1,t2,t3,t4,t5,t6]

Expected behavior: step 5 show tag keys from m1 should return result=[t1], because in step 4, insert a point which only has one tag, t1

Actual behavior: step 5 show tag keys from m1 return result=[t1,t2,t3,t4,t5,t6], tags in old measurement "m1" reappeared, like t2,t3,t4,t5,t6

Environment info: Centos 7, influxdb 1.8.0

Config: use default config, created by command "influxd config"

the BUG seems only appear when tsi file created.

I notice the issue #10052 "Old fields and tags show up after dropping measurement and rewriting", show field keys result is OK, but show tag keys seem wrong, it apparently seems a serious BUG.

ketewang commented 1 year ago

I'm having the same issue with influxdb 1.8.9. After "drop measurement xxxx" and "show tag keys from xxxx", I can still see old tags that were inserted before...