{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/6488","repository_url":"https://api.github.com/repos/influxdata/influxdb","labels_url":"https://api.github.com/repos/influxdata/influxdb/issues/6488/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/influxdb/issues/6488/comments","events_url":"https://api.github.com/repos/influxdata/influxdb/issues/6488/events","html_url":"https://github.com/influxdata/influxdb/issues/6488","id":151549226,"number":6488,"title":"panic in influxdb start caused by data format change","user":{"login":"melson-jao","id":14833004,"avatar_url":"https://avatars.githubusercontent.com/u/14833004?v=3","gravatar_id":"","url":"https://api.github.com/users/melson-jao","html_url":"https://github.com/melson-jao","followers_url":"https://api.github.com/users/melson-jao/followers","following_url":"https://api.github.com/users/melson-jao/following{/other_user}","gists_url":"https://api.github.com/users/melson-jao/gists{/gist_id}","starred_url":"https://api.github.com/users/melson-jao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melson-jao/subscriptions","organizations_url":"https://api.github.com/users/melson-jao/orgs","repos_url":"https://api.github.com/users/melson-jao/repos","events_url":"https://api.github.com/users/melson-jao/events{/privacy}","received_events_url":"https://api.github.com/users/melson-jao/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/influxdata/influxdb/labels/panic","name":"panic","color":"cc0000"},{"url":"https://api.github.com/repos/influxdata/influxdb/labels/tsm","name":"tsm","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-04-28T04:53:32Z","updated_at":"2016-04-28T19:01:08Z","closed_at":null,"body":"Revision: 0.10.0\r\nReproduce procedure:\r\n1. insert some data to a measurement xxx with FloatValue\r\n2. Use influxdb web GUI, ex http://127.0.0.1:8083, and run command \"DROP MEASUREMENT xxx\"\r\n3. insert some data to a measurement xxx with IntValue (new measurement xxx is created with new format and new data is saved without any problem)\r\n4. restart influxdb and it will panic because it load new data with IntValue but still have some old data with FloatValue\r\n\r\nCrash Log:\r\nPlease check the attachment.\r\n[influxdb-crash-log.txt](https://github.com/influxdata/influxdb/files/239916/influxdb-crash-log.txt)\r\n\r\nBTW, I also reproduce the same issue at v0.9.5.\r\n\r\n\r\nHere is the story:\r\n\r\nI update influxdb-java lib and then some data are saved to influxdb as INT64 but there is existed FLOAT64 data there.\r\nSo, I try to drop existed measurement and all new data are saved to new created measurement as INT64 without any error, looks fine.\r\n\r\nBut, when I restart influxdb, it is panic with message like\r\n\"panic: interface conversion: tsm1.Value is *tsm1.Int64Value, not *tsm1.FloatValue\"\r\nAnd I have to remove several file under /var/lib/influxdb/data/[db-name]/default/XXX/xxx.tsm1 to make influxdb come back to service again.\r\n\r\nCan anyone provide some advice or document about how to update measurement if some data format is changed? Or how to clean remove the old measurement data to avoid influxdb load it at startup? Look like \"drop measuremetn xxx\" is not clean enough.\r\n\r\nBTW, after check some related discussion, I decide to update my code with some type cast to force to save all number data to influxdb in float data type to make thing simple and uniform. Is it suggested? Welcome for any better idea or suggestions.\r\n\r\nFinally, how about just skip to load unexpected format old data with warning message instead of panic or crash directly?  Everything goes fine in running but fail at influxdb restart is a risk. Someone, like me, will think everything is done after measurement recreated but actually it will crash in days or months when influxdb restart happens.\r\n"},"comment":{"url":"https://api.github.com/repos/influxdata/influxdb/issues/comments/215529225","html_url":"https://github.com/influxdata/influxdb/issues/6488#issuecomment-215529225","issue_url":"https://api.github.com/repos/influxdata/influxdb/issues/6488","id":215529225,"user":{"login":"jwilder","id":219935,"avatar_url":"https://avatars.githubusercontent.com/u/219935?v=3","gravatar_id":"","url":"https://api.github.com/users/jwilder","html_url":"https://github.com/jwilder","followers_url":"https://api.github.com/users/jwilder/followers","following_url":"https://api.github.com/users/jwilder/following{/other_user}","gists_url":"https://api.github.com/users/jwilder/gists{/gist_id}","starred_url":"https://api.github.com/users/jwilder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwilder/subscriptions","organizations_url":"https://api.github.com/users/jwilder/orgs","repos_url":"https://api.github.com/users/jwilder/repos","events_url":"https://api.github.com/users/jwilder/events{/privacy}","received_events_url":"https://api.github.com/users/jwilder/received_events","type":"User","site_admin":false},"created_at":"2016-04-28T19:01:08Z","updated_at":"2016-04-28T19:01:08Z","body":"@melson-jao Thanks.  I think what might have happened is that a compaction was running while the `drop measurement` ran and the compaction completed writing the old `int64` type. New data was stored as `float64`.  When a subsequent compaction ran, it had two files with different types."}}