Skip to content

L3VPN Prefix History marks all AdjRIB-IN/OUT and Pre/Post-policy routes as Pre-Policy + RIB-IN only #10

@v1shnya

Description

@v1shnya

Base table in the file "10_l3vpn.sql"

CREATE TABLE l3vpn_rib (
.....
	                       isPrePolicy             boolean             NOT NULL DEFAULT true,
	                       isAdjRibIn              boolean             NOT NULL DEFAULT true,
);

Dependent table (correct)

CREATE TABLE l3vpn_rib_log (
.....
	                           isPrePolicy             boolean             NOT NULL DEFAULT true,
	                           isAdjRibIn              boolean             NOT NULL DEFAULT true,
) TABLESPACE timeseries;

PostgreSQL function for the insertion into l3vpn_rib_log misses new.isPrePolicy and new.isAdjRibIn values!

CREATE OR REPLACE FUNCTION t_l3vpn_rib_update()
	RETURNS trigger AS $$
BEGIN
	IF (new.isWithdrawn) THEN
		INSERT INTO l3vpn_rib_log (isWithdrawn,prefix,prefix_len,base_attr_hash_id,peer_hash_id,origin_as,timestamp,
		                           rd,ext_community_list)
		VALUES (true,new.prefix,new.prefix_len,old.base_attr_hash_id,new.peer_hash_id,
		        old.origin_as,new.timestamp,old.rd,old.ext_community_list);
	ELSE
		INSERT INTO l3vpn_rib_log (isWithdrawn,prefix,prefix_len,base_attr_hash_id,peer_hash_id,origin_as,timestamp,
		                           rd,ext_community_list)
		VALUES (false,new.prefix,new.prefix_len,new.base_attr_hash_id,new.peer_hash_id,
		        new.origin_as,new.timestamp,new.rd,new.ext_community_list);
	END IF;

	RETURN NEW;
END;
$$ LANGUAGE plpgsql;

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions