influxdb/influxdb — pull request #1078 by jvshahid (2014-10-31 22:30:40+00:00)
Title: Expired shard's directory no longer getting deleted since 0.8.4?

Since we upgraded from 0.8.3 to 0.8.4 (and subsequently to 0.8.5), it looks like InfluxDB no longer deletes the directories containing expired shards' data. This is the log output from around the latest shard rollover which took place today at 01:00 CET:

```
Oct 30 00:32:30 influx influxdb[13368]: [10/30/14 00:32:30] [INFO] Checking for shards to drop
Oct 30 00:40:19 influx influxdb[13368]: [10/30/14 00:40:19] [INFO] Checking for shards to drop
Oct 30 00:50:19 influx influxdb[13368]: [10/30/14 00:50:19] [INFO] Checking for shards to drop
Oct 30 01:00:00 influx influxdb[13368]: [10/30/14 01:00:00] [INFO] No matching shards for write at time 1414627200000000u, creating...
Oct 30 01:00:00 influx influxdb[13368]: [10/30/14 01:00:00] [INFO] createShards for space default: start: Thu Oct 30 01:00:00 +0100 CET 2014. end: Fri Oct 31 01:00:00 +0100 CET 2014
Oct 30 01:00:01 influx influxdb[13368]: [10/30/14 01:00:01] [INFO] DATASTORE: opening or creating shard /var/influxdb/db/shard_db_v2/00066
Oct 30 01:00:01 influx influxdb[13368]: [10/30/14 01:00:01] [INFO] Adding shard to default: 66 - start: Thu Oct 30 01:00:00 +0100 CET 2014 (1414627200). end: Fri Oct 31 01:00:00 +0100 CET 2014 (1414713600). isLocal: true. servers: [1]
Oct 30 01:02:15 influx influxdb[13368]: [10/30/14 01:02:15] [INFO] Checking for shards to drop
Oct 30 01:10:19 influx influxdb[13368]: [10/30/14 01:10:19] [INFO] Checking for shards to drop
Oct 30 01:20:19 influx influxdb[13368]: [10/30/14 01:20:19] [INFO] Checking for shards to drop
```

At this time, older shard number 61 expired and was actually removed from the configuration (i.e. it's no longer visible in the admin GUI), but as opposed to the behavior we had in 0.8.3, the directory containing the RocksDB data didn't get removed.