Skip to content

pgs-replay won't parse pcap file #1

@mrimbault

Description

@mrimbault

Hello !

I want to replay messages on a local PostgreSQL cluster from a previously generated pcap file, but it seems that the file is not parsed at all.

The pcap file is generated with tcpdump, capturing traffic from a local 9.1 PostgreSQL cluster
The command used to generate the pcap file :

tcpdump -i lo port 5433 -w /home/postgres_data/tcpdump

Then I generate some writes with pgbench, and interrupt tcpdump when it's done :

pgbench -h 127.0.0.1 -p 5433 -i -F 100 -s 2 pgbench

At this point I want to replay the messages on a 9.2 local cluster.
Thus, the command used is :

pgs-replay --rhost 127.0.0.1 --rport 5437 --role postgres --read /home/postgres_data/tcpdump

pg_hba acces mode is "trust" for localhost.
The pgbench database exists on both clusters.

No data is inserted on the 9.2 cluster, and nothing appears on the PostgreSQL logs either (log_min_duration_statement set to 0).

Doing some perl debugging, I can see that everything seems going well until the call for "process_all" subroutine.
At this point, I suppose that a call should be done to the "Replay" subroutine, but it doesn't happen.

The end of the debug trace :

339:    $shark->process_all();
pgShark::process_all(/usr/local/share/perl/5.10.1/pgShark.pm:355):
355:        my $self = shift;
pgShark::process_all(/usr/local/share/perl/5.10.1/pgShark.pm:360):
360:        dprint 2, "PCAP: start to loop over captured packet." if DEBUG;
pgShark::process_all(/usr/local/share/perl/5.10.1/pgShark.pm:363):
363:        Net::Pcap::pcap_loop( $pcaps{ $self->{'id'} },
364:            -1, \&process_packet, $self )
365:            if exists $pcaps{ $self->{'id'} };
main::(/usr/local/bin/pgs-replay:341):
341:    $shark->close();
pgShark::close(/usr/local/share/perl/5.10.1/pgShark.pm:307):
307:        my $self = shift;
pgShark::close(/usr/local/share/perl/5.10.1/pgShark.pm:309):
309:        Net::Pcap::pcap_close( $pcaps{ $self->{'id'} } )
310:            if exists $pcaps{ $self->{'id'} };
pgShark::close(/usr/local/share/perl/5.10.1/pgShark.pm:312):
312:        dprint 2, "PCAP: pcap stream %u closed.", $self->{'id'} if DEBUG;
pgShark::close(/usr/local/share/perl/5.10.1/pgShark.pm:314):
314:        delete $pcaps{ $self->{'id'} };
main::(/usr/local/bin/pgs-replay:343):
343:    exit 0;
pgShark::DESTROY(/usr/local/share/perl/5.10.1/pgShark.pm:847):
847:        my $self = shift;
pgShark::DESTROY(/usr/local/share/perl/5.10.1/pgShark.pm:849):
849:        if ( exists $pcaps{ $self->{'id'} } ) {
pgShark::DESTROY(/usr/local/share/perl/5.10.1/pgShark.pm:853):
853:        dprint 1, "pgShark: Total number of messages processed: %d.",
854:            $self->{'msg_count'}
855:            if DEBUG;

I also checked for the number of messages processed :

  DB<3> s
pgShark::DESTROY(/usr/local/share/perl/5.10.1/pgShark.pm:853):
853:        dprint 1, "pgShark: Total number of messages processed: %d.",
854:            $self->{'msg_count'}
855:            if DEBUG;

 DB<3> p $self->{'msg_count'}
0

I suppose I may be doing something wrong, but I can't figure what it is.
I can upload the whole debug trace if that can be of any help, or any configuration file you may need.

Thanks !

Mael

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions