Would it be possible to explain how DataMiner is determining the Element ID?
When installing DataMiner the 1st element created gets ID 1. Today we are already above 16000.
Elements are frequently removed and re-created, even so, is it possible/normal that an element ID gets so big?
When an element is removed, how does DataMiner handle all the linked data? such as trend data, alarm data, ... Can a removed element affect the server with lingering data?
DataMiner stores the highest Element ID in the elementid attribute of the <DataMiner> tag of C:\Skyline DataMiner\DataMiner.xml. When a new element is created it will increment that value and that will be the Element ID of the new element. I don't think it's unusual for an Element ID to hit 16000, especially when there could have been some scripting involved. On some internal test clusters, we reached Element ID 803 000. Element IDs are stored as an integer so the maximum value (2.1 billion) is unlikely to be hit.
There are some exceptions to this, for example when an element is DELT imported or migrated it will keep the original Element ID. It's important to note that the Element ID itself does not make the unique identifier for every element, it's actually the combination of DataMiner ID/Element ID. It's possible to DELT import an element with ID 1 from DataMiner 100, into DataMiner 200 where an element with ID 1 already exists.
When an element is deleted all data (including trending, alarming) should be removed. Important to note here is that on Cassandra the data will not be removed from the disk immediately, Cassandra will create a tombstone, which will then remove the data during the next compaction. DataMiner should no longer know this element though.
Q1) I tried this and no it will overflow to int.MinValue (-2147483648) and go up from there again. I did notice Cube got stuck after creating the element, no RTE was created though. The element also never showed up in the surveyor. Even after a DataMiner restart the element doesn’t show up (a timeout alarm on that element did though). See logging below. So I think some places in DataMiner are not prepared for this yet.
CElement::Activate|DBG|0|** Activating element Int.MaxValue (470/2147483647)
CElement::Activate|DBG|0|** Activating element int.MaxValue+1 (470/-2147483648)
Element.xml: <Element dataMinerId="470" id="-2147483648"
DataMiner.xml: <DataMiner id="470" elementid="-2147483648"
Q2) I also tried this with elementId -1, made two elements, the first one got ID 470/0. The second one got 470/9 (the first ID that was free on my dma). So it looks like it will exclude the existing number yes.
Extra note, I noticed I cannot delete the element with ID 0, an exception is thrown.
Additional questions:
Q1) If the Element ID reached up to the maximum value, a new element ID which is added after it will be start from “1 “ again?
Q2) Or the new element ID will be created sequential by excluding existing numbers?