Old Census Data

Hi there

I noticed that when looking within the census data of my ring it contains old services that are not running any more, a few references to typos I created when loading services etc, how and when is that data removed?

Second thing I’ve noticed that when I load a svc it’s propagated quickly with the census (happy days) but the members (for that service) is still listed when I unload the service.

Is that by design? Or anyone know of a workaround I could do to update the census to remove the entries.

Thank you


Hi Gary,

Unfortunately, due to design decisions that were made at the very beginning of this project, that data is never removed. It is by design, although given the hindsight we have now, it’s admittedly a sub-optimal design.

I spent quite a lot of time and energy this year attempting to fix this design decision by implementing a garbage collection mechanism of sorts for the rumor/census data. Ultimately, however, my PR was shelved indefinitely, as there was a lack of confidence in our ability to prove it wouldn’t break everything.

Low staffing resources and shifting priorities mean that it’s unlikely for that work to resurface in the near future. Here is the PR if you’re interested in browsing the code or the lengthy discussion that went with it.

Worse than old census data is the fact that I often see (in long-running rings) services being bound with stale and sometimes departed services.

Worth to mention that we cannot purge any data manually, for example I can’t delete uploaded files: https://github.com/habitat-sh/habitat/issues/6930

I think at least manual cleanup should be available for an user as workaround in such cases

There’s a nuclear option of sorts if you really want to clean things out and start over. This is not something we support or recommend, but if you rm -fr /hab/sup on every node in your network, they will all start over from scratch.

Keep in mind that doing this means you lose everything. Member IDs will change, config will be lost, nodes will rediscover themselves, etc. This is the “everything is hosed and starting over from zero is better than nothing” option.

And yes, the team is painfully aware of the fact that this isn’t a good user experience. We’d love to make some improvements in this area.