Skip to content

Commit

Permalink
pass immediately_reserve as true when creating physical replication slot
Browse files Browse the repository at this point in the history
  • Loading branch information
var77 committed Jun 28, 2024
1 parent 067fa33 commit 878a66d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion model/lantern/lantern_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def create_logical_replication_slot(name)
end

def create_physical_replication_slot(name)
representative_server.run_query("SELECT lsn FROM pg_create_physical_replication_slot('#{name}');").chomp.strip
representative_server.run_query("SELECT lsn FROM pg_create_physical_replication_slot('#{name}', true);").chomp.strip
end

def delete_replication_slot(name)
Expand Down
2 changes: 1 addition & 1 deletion spec/model/lantern/lantern_resource_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
it "creates new physical replication slot" do
representative_server = instance_double(LanternServer)
expect(lantern_resource).to receive(:representative_server).and_return(representative_server).at_least(:once)
expect(lantern_resource.representative_server).to receive(:run_query).with("SELECT lsn FROM pg_create_physical_replication_slot('test');").and_return("0/6002748 \n")
expect(lantern_resource.representative_server).to receive(:run_query).with("SELECT lsn FROM pg_create_physical_replication_slot('test', true);").and_return("0/6002748 \n")
expect(lantern_resource.create_physical_replication_slot("test")).to eq("0/6002748")
end
end
Expand Down

0 comments on commit 878a66d

Please sign in to comment.