M.Zharkikh's personal site logo
Mail to site
Print version
News (RSS)
Smereka / For administrators / Tree repair

Smereka

For administrators

Tree repair

One should understand the difference between database backup and tree repair. Database backup is intended to prevent database accidents such as damage of the tables that make Smereka completely unusable. While making database backup table all archived "as is" with all possible logical errors.

Tree repair is intended to finding and fixing logical errors. This requires that the database was workable. To make the repair one should register in the system as global administrator and in the personal office click the link to "repair the tree".

Then one should select what types of inspections must be completed and set the mode "Diagnosis" or "Repair". When prompted, "Diagnostics" will only count the number of injuries, and the command "Repair" not only detects but also corrects the detected errors.

Lost nodes search

The node is assumed to be lost if it's parent attribute does not coincide with the values id field for some record in the nodes table. Such a node and all its crown will not be shown correctly by Smereka. Repair consist in moving this node to a position of "Recycle bin" child node. There one can review and delete it or move in the desired position.

Cyclic references search

Cycle links (or recursive reference) is formed when some node have parent attribute that point to the child node. In the simplest case, the "AAA" node is an ancestor of the "BBB" node and "BBB" node is an ancestor of the "AAA" node. Cyclic reference leads Smereka to fail. Repair consist in breaking the cycle at arbitrary point and moving the root node to "Recycle bin".

Restoration of the sort order

Repair consist in re-assigning the seqpos attribute values. This operation is hierarchical and can be run for the whole trees or for the crown of some node.

Checking the symbolic names uniqueness

If the two sibling nodes have the same symbolic names, only one of them will be available via symbolic addressing (with numeric addressing both available). It is not possible to determine in advance which particular node will be chosen. Repair consist in assigning to a duplicate names numerical suffixes 0..9, 10..99, etc. If a symbolic name have the maximum length numeric suffixes replace the last characters of the name. This operation is hierarchical and can be run for the whole trees or for the crown of some node.

Search for lost attributes

The attribute is assumed to be lost if its nodeid field is not equal to the value of id field for some nodes table record. This attribute will never be used. Quick repair consist in removing all such records. Conservative repair consist in the joining of these attributes to the "Recycle bin". There one can review and delete it or use it in other way.

Check the links integrity

The links integrity occurs when all links attributes have the appropriate records in the nodes table. Repair consist in assigning all broken links the nil value.

Other errors

Recycle bin: subdomain must have only one Recycle bin. Other "Recycle bins" assumed to be errors. During the repair all found "Recycle bins" combined into one. The extra nodes are removed.

Previous section | Table of content | Next section

Please this page? Help us to develop this site!

1978 2018 N.I.Zharkikh

Reprinting of articles from site are encouraged while
reference (hyperlink) to my site is provided

Site powered by

Load count : 1857

Modified : 8.08.2017

If you look up the type error
on this page, please select it
by mouse and press Ctrl+Enter.