Skip to content

sl: Fix bug with password set timestamp#28855

Merged
michael-redpanda merged 1 commit into
redpanda-data:devfrom
michael-redpanda:sl/core-14924
Dec 5, 2025
Merged

sl: Fix bug with password set timestamp#28855
michael-redpanda merged 1 commit into
redpanda-data:devfrom
michael-redpanda:sl/core-14924

Conversation

@michael-redpanda

Copy link
Copy Markdown
Contributor

This fixes a bug where if a user updates a Shadow Link with the same password the set at timestamp clears to Unix Epoch.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

Bug Fixes

  • Fixed a bug where if a user updates a Shadow Link with the same password the password set at timestamp was cleared. Now if they use the same password, the timestamp is kept at its previous value

This fixes a bug where if a user updates a Shadow Link with the same
password the set at timestamp clears to Unix Epoch.

Signed-off-by: Michael Boquard <michael@redpanda.com>
@michael-redpanda michael-redpanda self-assigned this Dec 4, 2025
Copilot AI review requested due to automatic review settings December 4, 2025 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a bug in Shadow Link password timestamp handling where updating a Shadow Link with the same password would incorrectly clear the password set timestamp to Unix Epoch. The fix ensures that when the password remains unchanged, the existing timestamp is preserved.

Key Changes:

  • Modified the timestamp update logic to preserve the original timestamp when passwords match
  • Added test coverage to verify the timestamp preservation behavior

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/v/redpanda/admin/services/shadow_link/converter.cc Added assignment to preserve password timestamp before checking if password changed
tests/rptest/tests/cluster_linking_topic_syncing_test.py Added test case to verify password timestamp preservation when updating with same password

Comment on lines +1187 to 1190
c.password_last_updated = from_creds.password_last_updated;
if (from_creds.password != c.password) {
c.password_last_updated = model::timestamp::now();
return;

Copilot AI Dec 4, 2025

Copy link

Choose a reason for hiding this comment

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

The assignment at line 1187 is unconditionally executed before the conditional check. If the password has changed (line 1188), the timestamp is set twice: first to from_creds.password_last_updated and then to now(). Consider moving line 1187 into an else block after the password comparison to avoid the redundant assignment when passwords differ.

Suggested change
c.password_last_updated = from_creds.password_last_updated;
if (from_creds.password != c.password) {
c.password_last_updated = model::timestamp::now();
return;
if (from_creds.password != c.password) {
c.password_last_updated = model::timestamp::now();
return;
} else {
c.password_last_updated = from_creds.password_last_updated;

Copilot uses AI. Check for mistakes.
@vbotbuildovich

vbotbuildovich commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator

Retry command for Build#77362

please wait until all jobs are finished before running the slash command

/ci-repeat 1
skip-redpanda-build
skip-units
skip-rebase
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"lz4"}
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"gzip"}
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"zstd"}
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"snappy"}
tests/rptest/transactions/tx_upgrade_test.py::TxUpgradeCompactionTest.upgrade_with_compaction_test

@vbotbuildovich

Copy link
Copy Markdown
Collaborator

CI test results

test results on build#77362
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
JavaCompressionTest test_upgrade_java_compression {"compression_type": "gzip"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6a-1af0-475d-bad2-31598f3101b1 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "gzip"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6c-4c03-42bb-8a2a-78c917178184 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "lz4"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6a-1af2-4f29-b029-4f5c7d7d11cd FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "lz4"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6c-4c05-43ca-a03d-da5274a42a61 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "snappy"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6a-1af3-4646-94b3-3b3b039e0880 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "snappy"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6c-4c06-4526-a999-2b506f89f937 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "zstd"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6a-1af4-4a7b-9e98-4aa595e76713 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
JavaCompressionTest test_upgrade_java_compression {"compression_type": "zstd"} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6c-4c08-41e1-9c86-d1db8a54df5e FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=JavaCompressionTest&test_method=test_upgrade_java_compression
PartitionReassignmentsTest test_reassignments_cancel null integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6a-1af3-4646-94b3-3b3b039e0880 FLAKY 14/21 upstream reliability is '95.63106796116504'. current run reliability is '66.66666666666666'. drift is 28.9644 and the allowed drift is set to 50. The test should PASS https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=PartitionReassignmentsTest&test_method=test_reassignments_cancel
RedpandaNodeOperationsSmokeTest test_node_ops_smoke_test {"cloud_storage_type": 1, "mixed_versions": true} integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6a-1af0-475d-bad2-31598f3101b1 FLAKY 13/21 upstream reliability is '99.50980392156863'. current run reliability is '61.904761904761905'. drift is 37.60504 and the allowed drift is set to 50. The test should PASS https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=RedpandaNodeOperationsSmokeTest&test_method=test_node_ops_smoke_test
TxUpgradeCompactionTest upgrade_with_compaction_test null integration https://buildkite.com/redpanda/redpanda/builds/77362#019aeb6c-4c06-4526-a999-2b506f89f937 FAIL 0/21 The test has failed across all retries https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=TxUpgradeCompactionTest&test_method=upgrade_with_compaction_test

@michael-redpanda

Copy link
Copy Markdown
Contributor Author

/ci-repeat 1
skip-redpanda-build
skip-units
skip-rebase
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"lz4"}
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"gzip"}
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"zstd"}
tests/rptest/tests/compatibility/java_compression_test.py::JavaCompressionTest.test_upgrade_java_compression@{"compression_type":"snappy"}
tests/rptest/transactions/tx_upgrade_test.py::TxUpgradeCompactionTest.upgrade_with_compaction_test

@michael-redpanda michael-redpanda merged commit d9561fd into redpanda-data:dev Dec 5, 2025
22 checks passed
@vbotbuildovich

Copy link
Copy Markdown
Collaborator

/backport v25.3.x

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.

4 participants