Hello,
I have been trying to restore some lost data into an other existing database and noticed a weird behaviour.
This page explains how to restore data from an healthy database to an existing one with downtimes : Back up and restore data in InfluxDB v1.8 | InfluxDB OSS 1.8 Documentation
Here’s what I did to reproduce the problem , step by step:
1 - Backup of the healthy database
2 - Restored the healthy database on the faulty instance with the name database_bak
3 - Then I ran this , while connected to database_bak
SELECT * INTO pgwatch2.three_months.:MEASUREMENT FROM /.*/ WHERE time > now() - 4d GROUP BY *
which led me to this error :
ERR: partial write: field type conflict: input field "idle" on measurement "backends" is type float, already exists as type integer dropped=585
Alright, I guess there are some type issues between the backup and the db
show field keys from backends
name: backends
fieldKey fieldType
-------- ---------
active integer
av_workers integer
background_workers integer
idle integer
idleintransaction integer
instance_total integer
longest_autovacuum_seconds integer
longest_query_seconds integer
longest_session_seconds integer
longest_tx_seconds integer
max_connections integer
max_xmin_age_tx integer
total integer
waiting integer
This command did not show any anomalies, all my measurements were integers, both on the backup and faulty database.
Afterwards, I decided to reinsert measurements one by one, and did not see any issues. Everything was copied into the faulty database.
Is there something wrong I am missing with the way I tried to reinsert all the measurements at the same time ?