Skip to content

Commit af8c90c

Browse files
committed
Fix missing partition path when opening a named partition database instance
- Fdb.OpenNamedPartitionAsync(...) should return a instance where db.Directory.FullName is the same as the partition Path - Fixed invalid DebuggerDisplay attributes for FdbDirectoryLayer and FdbDatabasePartition
1 parent 170e7ab commit af8c90c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

FoundationDB.Client/Layers/Directories/FdbDirectoryLayer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ namespace FoundationDB.Layers.Directories
4747
/// <see cref="FdbDirectoryLayer"/> exposes methods to create, open, move, remove, or list directories. Creating or opening a directory returns the corresponding subspace.
4848
/// The <see cref="FdbDirectorySubspace"/> class represents subspaces that store the contents of a directory. An instance of <see cref="FdbDirectorySubspace"/> can be used for all the usual subspace operations. It can also be used to operate on the directory with which it was opened.
4949
/// </summary>
50-
[DebuggerDisplay("Nodes={this.NodeSubspace}, Contents={this.ContentsSubspace}")]
50+
[DebuggerDisplay("FullName={FullName}, Contents={ContentSubspace}, Nodes={NodeSubspace}")]
5151
public class FdbDirectoryLayer : IFdbDirectory
5252
{
5353
private const int SUBDIRS = 0;

FoundationDB.Client/Subspaces/Fdb.Directory.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public static async Task<IFdbDatabase> OpenNamedPartitionAsync(string clusterFil
8686
// we have to chroot the database to the new prefix, and create a new DirectoryLayer with a new '/'
8787
rootSpace = descriptor.Copy(); //note: create a copy of the key
8888
//TODO: find a nicer way to do that!
89-
db.ChangeRoot(rootSpace, FdbDirectoryLayer.Create(rootSpace), readOnly);
89+
db.ChangeRoot(rootSpace, FdbDirectoryLayer.Create(rootSpace, partitionPath), readOnly);
9090

9191
if (Logging.On) Logging.Info(typeof(Fdb.Directory), "OpenNamedPartitionAsync", String.Format("Opened partition {0} at {1}, using directory layer at {2}", descriptor.FullName, db.GlobalSpace, db.Directory.DirectoryLayer.NodeSubspace));
9292

FoundationDB.Client/Subspaces/FdbDatabasePartition.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace FoundationDB.Client
3737
using System.Threading.Tasks;
3838

3939
/// <summary>View of a database that is bound to a specific Partition</summary>
40-
[DebuggerDisplay("Database={Database.Name}, Contents={Directory.ContentsSubspace}, Nodes={Directory.NodeSubspace}")]
40+
[DebuggerDisplay("Database={Database.Name}, Partition={Directory.FullName}, Prefix={Database.GlobalSpace}")]
4141
public sealed class FdbDatabasePartition : IFdbDirectory
4242
{
4343
private readonly IFdbDatabase m_database;

0 commit comments

Comments
 (0)