[PDB-1550] PR (1422): (maint) don't activate the node when it's already active - wkalt Created: 2015/05/27  Updated: 2015/06/11  Resolved: 2015/06/02

Status: Closed
Project: PuppetDB
Component/s: None
Affects Version/s: None
Fix Version/s: PDB 2.3.5

Type: Improvement Priority: Normal
Reporter: gepetto-bot Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: github
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Story Points: 1
Sprint: PuppetDB 2015-06-03

 Description   

rt(maint) don't activate the node when it's already active

Pull Request Description


Before this commit we were updating the deactivated column of certnames to null
even if it was already null. This caused unnecessary contention on the certnames
table with each command submission, causing more frequent retries than needed.

Also corrects the corresponding test logic: if nothing happens, then no records
are updated, and the result of maybe-activate-node should not be positive.


(webhooks-id: adcb919078716d7283f7ff7fc231f097)



 Comments   
Comment by gepetto-bot [ 2015/05/27 ]

wkalt commented:

this only affects things when running with command-processing-threads > 1. The easiest way to verify is to make the corresponding change in master and observe your retried commands. Postgres logs will also no longer show this kind of thing (example from master):

```
9955 2015-05-27 13:05:56.746 PDT [db:puppetdb,sess:5566239e.bab3,pid:47795,vtid:9/3179,tid:7817153] ERROR: could not serialize access due to concurrent update
9956 2015-05-27 13:05:56.746 PDT [db:puppetdb,sess:5566239e.bab3,pid:47795,vtid:9/3179,tid:7817153] STATEMENT: UPDATE certnames SET deactivated=$1, expired=$2 WHERE certname=$3 AND (deactivated<$4 OR deactivated IS NULL) AND (expired<$5 OR expired IS NULL)
```

(i.e that specific statement)

Comment by gepetto-bot [ 2015/05/27 ]

pljenkinsro commented:

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/1316/

Comment by gepetto-bot [ 2015/05/27 ]

pljenkinsro commented:

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/1319/

Comment by gepetto-bot [ 2015/05/28 ]

pljenkinsro commented:

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://jenkins.puppetlabs.com/job/platform_puppetdb_intn-sys_pr/1323/

Comment by gepetto-bot [ 2015/05/28 ]

ajroetker commented:

:+1:

Comment by gepetto-bot [ 2015/05/29 ]

mullr commented:

I'm :+1: on this in master, but we decided to skip it in stable.

Comment by gepetto-bot [ 2015/06/01 ]

wkalt commented:

I'll stick it on master if we still want it there. My assumption based on the conversation this morning is that this is going into stable.

Comment by gepetto-bot [ 2015/06/01 ]

ajroetker commented:

Yeah sounded like stable is good from this morning

Comment by gepetto-bot [ 2015/06/02 ]

senior commented:

+1 will merge once test disk issues have been resolved

Comment by gepetto-bot [ 2015/06/02 ]

Pull request (maint) don't activate the node when it's already active has been closed.

Generated at Sun Aug 25 04:59:46 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.