Send Netdot-devel mailing list submissions to
[email protected]
To subscribe or unsubscribe via the World Wide Web, visit
https://osl.uoregon.edu/mailman/listinfo/netdot-devel
or, via email, send a message with subject or body 'help' to
[email protected]
You can reach the person managing the list at
[email protected]
When replying, please edit your Subject line so it is more specific
than "Re: Contents of Netdot-devel digest..."
Today's Topics:
1. [Netdot - Bug #1901] parent value of
container/subnets/address getting overwritten by _update_tree()
([email protected])
----------------------------------------------------------------------
Message: 1
Date: Tue, 12 Jul 2016 12:16:17 -0700
From: [email protected]
Subject: [Netdot-devel] [Netdot - Bug #1901] parent value of
container/subnets/address getting overwritten by _update_tree()
To: [email protected], [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset=utf-8
Issue #1901 has been updated by Matt Zagrabelny.
Some more details:
PostgreSQL 9.4.8-0+deb8u1
Netdot 1.0.7 (stock release)
Apache 2.4.10-10+deb8u4
I just dumped and recreated the database. Here is the parent chain for
10.34.56.1 after I create it:
[*]: 10.0.0.0/8 : 10.34.0.0/16 : 10.34.56.1
The subnet 10.34.56.0/24 is missing from the chain.
When I click 10.34.0.0/16 and drill down to 10.34.56.0/24, I see:
10.34.56.1 as static - which is correct.
But the fact that the actual containing subnet is missing is puzzling.
----------------------------------------
Bug #1901: parent value of container/subnets/address getting overwritten by
_update_tree()
https://osl.uoregon.edu/redmine/issues/1901#change-3356
Author: Matt Zagrabelny
Status: New
Priority: High
Assignee:
Category:
Target version:
Resolution:
Greetings,
I'm experiencing an issue with containers and subnets not finding their parents
correctly. It looks to be related to the entries in the datacache table.
I create a container: 10.34.0.0/16. It has the correct parent of 10.0.0.0/8.
I then create a subnet: 10.34.56.0/24. It also (incorrectly) has a parent of
10.0.0.0/8. Whereas its parent should be 10.34.0.0/16.
I create a static address: 10.34.56.1/32. Again, parent of 10.0.0.0/8 - not
10.34.56.0/24.
I've traced the code to Netdot::Model::Ipblock::insert's:
$newblock->_update_tree();
That subroutine changes the parent value from the correct value (id) to the
10.0.0.0/8 id (which is 3 in our database.)
Here are the audit logs of the parent getting reset:
Jul 12 13:12:41 netdot-web netdot: DEBUG - Ipblock::_tree_get: iptree4 thawed
from cache
Jul 12 13:12:41 netdot-web netdot: DEBUG - Ipblock::_tree_get: Retrieved iptree4
Jul 12 13:12:41 netdot-web netdot: DEBUG - Ipblock::_update_tree: Updating tree
for 10.34.56.1
Jul 12 13:12:41 netdot-web netdot: DEBUG - Model::insert: Inserted new record
96 in table: audit
Jul 12 13:12:41 netdot-web netdot: INFO - Netdot::Model::_audit: user:
mzagrabe, operation: update, table: ipblock, id: 34977 (10.34.56.1), fields:
(parent), values: ('3')
If I comment out that subroutine ($newblock->_update_tree()), the subnet and
static address have their correct parents.
Things only seem to start failing after we import our DNS zone data, not
before. This is also only happening on our (soon to be) *production* system,
not our test system. And it doesn't seem to be really repeatable. Things work
okay some of the time.
Performing a "DELETE FROM datacache;" seems to help, but we haven't narrowed it
down to a repeatable failure case and corrective adjustment.
I don't know exactly where to continue on my debugging. Any help or assistance
would be greatly appreciated.
And some data to back it up...
Here are database queries that:
A) Show the datacache _is_ being updated.
B) Show that the parent for the IPBlocks _is_ wrong.
netdot=# -- Before creating a test container 10.34.0.0/16
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468345568 | 2016-07-12 12:46:08-05
(1 row)
Time: 1.551 ms
netdot=# SELECT
netdot-# '0.0.0.0'::INET + cast(address AS BIGINT) AS ip,
netdot-# prefix,
netdot-# description,
netdot-# address,
netdot-# id,
netdot-# parent
netdot-# FROM
netdot-# ipblock
netdot-# WHERE
netdot-# address IN (
netdot(# ('10.0.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.1'::INET - '0.0.0.0'::INET)
netdot(# )
netdot-# ORDER BY
netdot-# address
netdot-# ;
ip | prefix | description | address | id | parent
----------+--------+-------------+-----------+----+--------
10.0.0.0 | 8 | RFC-1918 | 167772160 | 3 | (null)
(1 row)
Time: 1.151 ms
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468345568 | 2016-07-12 12:46:08-05
(1 row)
Time: 0.208 ms
netdot=# -- After creating a test container 10.34.0.0/16
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468346982 | 2016-07-12 13:09:42-05
(1 row)
Time: 0.400 ms
netdot=# SELECT
netdot-# '0.0.0.0'::INET + cast(address AS BIGINT) AS ip,
netdot-# prefix,
netdot-# description,
netdot-# address,
netdot-# id,
netdot-# parent
netdot-# FROM
netdot-# ipblock
netdot-# WHERE
netdot-# address IN (
netdot(# ('10.0.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.1'::INET - '0.0.0.0'::INET)
netdot(# )
netdot-# ORDER BY
netdot-# address
netdot-# ;
ip | prefix | description | address | id | parent
-----------+--------+----------------+-----------+-------+--------
10.0.0.0 | 8 | RFC-1918 | 167772160 | 3 | (null)
10.34.0.0 | 16 | test container | 170000384 | 34975 | 3
(2 rows)
Time: 0.477 ms
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468346982 | 2016-07-12 13:09:42-05
(1 row)
Time: 0.189 ms
netdot=# -- Before creating a test subnet 10.34.56.0/24
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468346982 | 2016-07-12 13:09:42-05
(1 row)
Time: 0.443 ms
netdot=# SELECT
netdot-# '0.0.0.0'::INET + cast(address AS BIGINT) AS ip,
netdot-# prefix,
netdot-# description,
netdot-# address,
netdot-# id,
netdot-# parent
netdot-# FROM
netdot-# ipblock
netdot-# WHERE
netdot-# address IN (
netdot(# ('10.0.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.1'::INET - '0.0.0.0'::INET)
netdot(# )
netdot-# ORDER BY
netdot-# address
netdot-# ;
ip | prefix | description | address | id | parent
-----------+--------+----------------+-----------+-------+--------
10.0.0.0 | 8 | RFC-1918 | 167772160 | 3 | (null)
10.34.0.0 | 16 | test container | 170000384 | 34975 | 3
(2 rows)
Time: 0.357 ms
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468346982 | 2016-07-12 13:09:42-05
(1 row)
Time: 0.184 ms
netdot=# -- After creating a test subnet 10.34.56.0/24
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468347096 | 2016-07-12 13:11:36-05
(1 row)
Time: 0.422 ms
netdot=# SELECT
netdot-# '0.0.0.0'::INET + cast(address AS BIGINT) AS ip,
netdot-# prefix,
netdot-# description,
netdot-# address,
netdot-# id,
netdot-# parent
netdot-# FROM
netdot-# ipblock
netdot-# WHERE
netdot-# address IN (
netdot(# ('10.0.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.1'::INET - '0.0.0.0'::INET)
netdot(# )
netdot-# ORDER BY
netdot-# address
netdot-# ;
ip | prefix | description | address | id | parent
------------+--------+----------------+-----------+-------+--------
10.0.0.0 | 8 | RFC-1918 | 167772160 | 3 | (null)
10.34.0.0 | 16 | test container | 170000384 | 34975 | 3
10.34.56.0 | 24 | test subnet | 170014720 | 34976 | 3
(3 rows)
Time: 0.386 ms
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468347096 | 2016-07-12 13:11:36-05
(1 row)
Time: 0.145 ms
netdot=# -- Before creating a test static 10.34.56.1/32
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468347096 | 2016-07-12 13:11:36-05
(1 row)
Time: 0.458 ms
netdot=# SELECT
netdot-# '0.0.0.0'::INET + cast(address AS BIGINT) AS ip,
netdot-# prefix,
netdot-# description,
netdot-# address,
netdot-# id,
netdot-# parent
netdot-# FROM
netdot-# ipblock
netdot-# WHERE
netdot-# address IN (
netdot(# ('10.0.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.1'::INET - '0.0.0.0'::INET)
netdot(# )
netdot-# ORDER BY
netdot-# address
netdot-# ;
ip | prefix | description | address | id | parent
------------+--------+----------------+-----------+-------+--------
10.0.0.0 | 8 | RFC-1918 | 167772160 | 3 | (null)
10.34.0.0 | 16 | test container | 170000384 | 34975 | 3
10.34.56.0 | 24 | test subnet | 170014720 | 34976 | 3
(3 rows)
Time: 0.416 ms
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468347096 | 2016-07-12 13:11:36-05
(1 row)
Time: 0.201 ms
netdot=# -- After creating a test static 10.34.56.1/32
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468347096 | 2016-07-12 13:11:36-05
(1 row)
Time: 0.397 ms
netdot=# SELECT
netdot-# '0.0.0.0'::INET + cast(address AS BIGINT) AS ip,
netdot-# prefix,
netdot-# description,
netdot-# address,
netdot-# id,
netdot-# parent
netdot-# FROM
netdot-# ipblock
netdot-# WHERE
netdot-# address IN (
netdot(# ('10.0.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.0.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.0'::INET - '0.0.0.0'::INET),
netdot(# ('10.34.56.1'::INET - '0.0.0.0'::INET)
netdot(# )
netdot-# ORDER BY
netdot-# address
netdot-# ;
ip | prefix | description | address | id | parent
------------+--------+----------------+-----------+-------+--------
10.0.0.0 | 8 | RFC-1918 | 167772160 | 3 | (null)
10.34.0.0 | 16 | test container | 170000384 | 34975 | 3
10.34.56.0 | 24 | test subnet | 170014720 | 34976 | 3
10.34.56.1 | 32 | (null) | 170014721 | 34977 | 3
(4 rows)
Time: 0.345 ms
netdot=# SELECT id, name, tstamp, to_timestamp(tstamp) FROM datacache;
id | name | tstamp | to_timestamp
----+---------+------------+------------------------
5 | iptree4 | 1468347096 | 2016-07-12 13:11:36-05
(1 row)
Time: 0.212 ms
netdot=#
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://osl.uoregon.edu/redmine/my/account
------------------------------
_______________________________________________
Netdot-devel mailing list
[email protected]
https://osl.uoregon.edu/mailman/listinfo/netdot-devel
End of Netdot-devel Digest, Vol 112, Issue 4
********************************************