Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PDS-586351] [Possibly RC only, though debatable] Mechanism for clearing a potentially inaccurate sweep namesToIds and vice versa mapping #7269

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from

Conversation

jeremyk-91
Copy link
Contributor

General

Before this PR: If an error arises in the sweep namesToIds/idsToNames mapping, targeted sweep is stuck, and there isn't a method for resetting said state.

After this PR:
==COMMIT_MSG==
Such a mechanism now exists.
==COMMIT_MSG==

Priority: P1

Concerns / possible downsides (what feedback would you like?):

  • Is this correct? Please read internal documentation carefully.

Is documentation needed?: Yes. For now I'd claim the javadoc + the internal documentation should suffice.

Compatibility

Does this PR create any API breaks (e.g. at the Java or HTTP layers) - if so, do we have compatibility?:
No.

Does this PR change the persisted format of any data - if so, do we have forward and backward compatibility?: Yes, but there is forward and backward compatibility - people are already able to deserialise the format where we write the string value of the table reference.

The code in this PR may be part of a blue-green deploy. Can upgrades from previous versions safely coexist? (Consider restarts of blue or green nodes.): Yes.

Does this PR rely on statements being true about other products at a deployment - if so, do we have correct product dependencies on these products (or other ways of verifying that these statements are true)?: I don't think so.

Does this PR need a schema migration? No.

Testing and Correctness

What, if any, assumptions are made about the current state of the world? If they change over time, how will we find out?:

What was existing testing like? What have you done to improve it?: New tests added.

If this PR contains complex concurrent or asynchronous code, is it correct? The onus is on the PR writer to demonstrate this.: The main thing is to check that the reset is idempotent, which I think is straightforward given the way in which this PR is to be used.

If this PR involves acquiring locks or other shared resources, how do we ensure that these are always released?: I don't think we do this.

Execution

How would I tell this PR works in production? (Metrics, logs, etc.): Log lines.

Has the safety of all log arguments been decided correctly?: I believe so.

Will this change significantly affect our spending on metrics or logs?: No

How would I tell that this PR does not work in production? (monitors, etc.): Either relevant logs, or nothing happens.

If this PR does not work as expected, how do I fix that state? Would rollback be straightforward?: Rollback

If the above plan is more complex than “recall and rollback”, please tag the support PoC here (if it is the end of the week, tag both the current and next PoC):

Scale

Would this PR be expected to pose a risk at scale? Think of the shopping product at our largest stack.: No

Would this PR be expected to perform a large number of database calls, and/or expensive database calls (e.g., row range scans, concurrent CAS)?: No

Would this PR ever, with time and scale, become the wrong thing to do - and if so, how would we know that we need to do something differently?: Eh, not sure this should even be long lived, and I know it doesn't scale (an alternative is written on the internal doc).

Development Process

Where should we start reviewing?: WriteReferencePersister, or its test depending on preference.

If this PR is in excess of 500 lines excluding versions lock-files, why does it not make sense to split it?: N/A

Please tag any other people who should be aware of this PR:
@jeremyk-91
@sverma30
@raiju

Copy link
Contributor

@mdaudali mdaudali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. I've also checked that:

  • The RFC outlines with what's implemented here
  • That we correctly do not create new mappings when using immediate referencing.
  • That 0 byte is the correct prefix for immediate referencing
  • That we can deserialise the config on each enum value.

"A failure was observed when truncating the sweep identifier tables. If you are running"
+ " this as part of a broader clearance task, you MUST make sure that the success"
+ " message is logged BEFORE considering the reset to have been performed. Seeing this"
+ " message is neither an indication that the operation was success, nor is it an"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but doesn't really matter so ignore it given this code is going to be ripped out: was a success / was successful (former is consistent with the rest of the sentence structure)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps worth writing in the SOP - if all nodes fail, either identify what the problem is, fix, and then bounce the nodes, or to just page someone, or some other guidance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as much as it hurts me, I will ignore the nit 😅

SOP comments added

WriteReferencePersister stringPersister = new WriteReferencePersister(
tableIndices, WriteMethod.TABLE_NAME_AS_STRING_BINARY, UnknownIdentifierHandlingMethod.THROW);
assertThat(stringPersister.unpersist(storedWriteReference))
.as("the string persister, given a known ID, should be able to interpret it")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tillyow tillyow mentioned this pull request Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants