Skip to content

Commit

Permalink
WT-9271 Clean up use of hard-coded numbers for object ids. (#7878)
Browse files Browse the repository at this point in the history
  • Loading branch information
sueloverso committed May 3, 2022
1 parent c74df15 commit 8e544c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/schema/schema_drop.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,8 @@ __drop_tiered(WT_SESSION_IMPL *session, const char *uri, bool force, const char
/*
* We remove all metadata entries for both the file and object versions of an object. The local
* retention means we can have both versions in the metadata. Ignore WT_NOTFOUND.
*
* Object ids start at 1.
*/
for (i = 1; i < tiered->current_id; ++i) {
for (i = tiered->oldest_id; i < tiered->current_id; ++i) {
WT_ERR(__wt_tiered_name(session, &tiered->iface, i, WT_TIERED_NAME_LOCAL, &name));
__wt_verbose(session, WT_VERB_TIERED, "DROP_TIERED: remove object %s from metadata", name);
WT_ERR_NOTFOUND_OK(__wt_metadata_remove(session, name), false);
Expand Down
2 changes: 1 addition & 1 deletion src/tiered/tiered_handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ __tiered_restart_work(WT_SESSION_IMPL *session, WT_TIERED *tiered)
bool exist;

/* If this is a new table and there are no objects there is nothing to do. */
if (tiered->current_id == 0)
if (tiered->current_id == WT_TIERED_OBJECTID_NONE)
return (0);

/*
Expand Down

0 comments on commit 8e544c1

Please sign in to comment.