Skip to content

rgw: temporarily disable calls to defer_gc() in RGWGetObj - #38253

Merged
cbodley merged 1 commit into
ceph:masterfrom
cbodley:wip-rgw-gc-disable-defer
Nov 24, 2020
Merged

cbodley merged 1 commit into
ceph:masterfrom
cbodley:wip-rgw-gc-disable-defer

Conversation

@cbodley

@cbodley cbodley commented Nov 23, 2020

Copy link
Copy Markdown
Contributor

cls_rgw_gc_queue_update_entry() is known to cause data loss when called
on objects that have not actually been scheduled for garbage collection

RGWGetObj is the only caller, and uses defer_gc() when reads are taking
a long time compared to rgw_gc_obj_min_wait. if an object has since been
deleted and submitted for garbage collection, this allows RGWGetObj to
defer that gc until the entire read completes

by disabling these calls to defer_gc(), very long reads (longer than 1hr,
with default configuration) may fail if the object gets deleted, and a
retry will result in a 404 Not Found error as expected

Fixes: https://tracker.ceph.com/issues/47866

Checklist

  • References tracker ticket
  • Updates documentation if necessary
  • Includes tests for new functionality or reproducer for bug

Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox

cls_rgw_gc_queue_update_entry() is known to cause data loss when called
on objects that have not actually been scheduled for garbage collection

RGWGetObj is the only caller, and uses defer_gc() when reads are taking
a long time compared to rgw_gc_obj_min_wait. if an object has since been
deleted and submitted for garbage collection, this allows RGWGetObj to
defer that gc until the entire read completes

by disabling these calls to defer_gc(), very long reads (longer than 1hr,
with default configuration) may fail if the object gets deleted, and a
retry will result in a 404 Not Found error as expected

Fixes: https://tracker.ceph.com/issues/47866

Signed-off-by: Casey Bodley <[email protected]>

@mattbenjamin mattbenjamin 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.

lgtm

Comment thread src/rgw/rgw_op.cc
gc_invalidate_time = start_time;
gc_invalidate_time += (s->cct->_conf->rgw_gc_obj_min_wait / 2);
}
/* garbage collection related handling:

@ivancich ivancich Nov 23, 2020 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since some version of this code will likely be resurrected, possibly controlled by a config option, I'd have preferred a "#if 0" rather than a delete for the sake of continuity between commits, especially given the word "temporarily" appears in the name of the PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

when we're ready, we can revert the commit. i think committing and reverting is the most direct way to make a temporary transformation to the code

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.

really? that doesn't match my experience, really

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.

@mattbenjamin @cbodley @ivancich : Is there agreement amongst everyone to revert this commit?

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.

@pritha-srivastava no objection, it comes out the same in the end

@cbodley

cbodley commented Nov 24, 2020

Copy link
Copy Markdown
Contributor Author

jenkins test api

@cbodley
cbodley merged commit 3fa037f into ceph:master Nov 24, 2020
@cbodley
cbodley deleted the wip-rgw-gc-disable-defer branch November 24, 2020 18:06
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