News:

We really need your input in this questionnaire

Main Menu

ID incremental

Started by sss, June 22, 2007, 05:45:18 PM

Previous topic - Next topic

jdl

Hi,

Minor remark...

When you define - for example - a new trap or event, if you then delete it, the corresponding ID looks to be unavailable. The next event created will have the next ID.
Is this the expected behavior? It looks to me like you are going to consume more IDs than expected?

Cheers,
Jdamien

Victor Kirhenshtein

Hello!

This is an expected behavior. Main idea is that all IDs should be unique,  so system just keeps first unused id and increments it after every creation. There are two reasons why we don't reuse freed IDs:
1. If, due to error, reference to deleted object will remain somewhere, it will later be threated as an error because ID is invalid. But, if we reuse the id, later it will be impossible to determine if this was undeleted reference to old object or valid reference to new one.
2. Optimization of code - server don't need to scan for free ID - not a big issue however.

It should not be a problem, because we have 32-bit IDs, so we have more than 4 billions of available IDs. I hardly imagine monitoring system where such number of id's can be exhausted in reasonable period of time. Even if system's administrator will create and delete new trap record every second, it takes more than 126 years to exhaust ID space. Also, if such problem ever arises, it will not be hard to write special database maintenance tool which will "compact" id space.

Best regards,
Victor